--
You received this message because you are subscribed to the Google Groups "HTML5 Discussion Group, India" group.
To post to this group, send email to html...@googlegroups.com.
To unsubscribe from this group, send email to html5-in+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/html5-in?hl=en.
You can also, of course, simply write the styles using a server side script like PHP. And put all the style rules in a loop.
You can also write a simple piece of JavaScript code which will set the backgrounds for each of the buttons.
The functionality you’re looking for is provided by the `attr()` function. CSS 2.1 limited its usage to the `content` property but CSS3 has made it usable in a lot more places, as well as made it slightly more capable.The markup would be something to the effect of:<button data-bg="i/b1.gif">Button 1</button><button data-bg="i/b2.gif">Button 2</button><button data-bg="i/b3.gif">Button 3</button><style>button { background-image: attr(data-bg url); }</style>Unfortunately, browsers are yet to implement the CSS3 draft version of `attr` (as far as I’m aware).Cheers,-Prateek
--
You received this message because you are subscribed to the Google Groups "HTML5 Discussion Group, India" group.
To view this discussion on the web visit https://groups.google.com/d/msg/html5-in/-/Qd_RddUyeGUJ.