well..yeah...but did you know u can do this?

IggyP

Aspirant
Joined
Jan 11, 2013
Messages
24
having some fun with this code today...someone asked me if it was possible and did not realize it actually is ;P

http://jsfiddle.net/tDQWN/129/

didnt realize u could just define your own attributes and call them in css like that...kinda cool....not sure what good besides custom title tooltip styling, but something im sure..

the tooltip styling itself tho is pretty cool enough i thought
 

Pete

Flavours of Forums Forever
Joined
Sep 9, 2013
Messages
2,694
That's the perk of the data attribute family, you can make them up on the spot and it's completely legitimate in HTML5. The styling is a necessary extension of being able to target attributes in general :)

As for the use of it, I can think of cases where you might have something like <article data-promoted="1"> where you're providing semantic value rather than cluttering the markup with what is otherwise purely stylistic constructs. (You don't need to add a class to this to style just the promoted items)
 
Top