Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
.simple:before {
content: attr(message) ", I'm a div with a 'message' attribute";
.data-based:before {
content: attr(data-message) ", I'm a div with a 'data-message' attribute";
<div class="simple" message="Hello there"></div>
<div class="data-based" data-message="Hello there"></div>
<selector>:[before|after] {
content: [attr(<attribute>) | 'plain text']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment