I'd like to have CSS that uses attr(data-attribute) to apply a CSS-rule.
For example, in my CSS:
@media max-width(480px) {
.mobile-float {
float: attr(data-mobile-float);
}
}
Then, in my HTML, I define the data-attribute:
<div data-mobile-float="right">
Floats right on mobile!
</div>
<div data-mobile-float="left">
Floats left on mobile!
</div>
I feel like I'm missing a character and it's not working. How do I do this correctly? Thanks!