where buttonid in "images/buttonid.gif" is the id attribute of the button element which is also the name of background image file for the respective button.
I am trying to define background image dynamically (assume adding a value of a variable) so that all the buttons in class ".buttons" have the respective background image.
Regards Pavan PHP
rafael couto
unread,
Oct 10, 2012, 4:23:35 PM10/10/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to html5-game-...@googlegroups.com
Guess you already realized its not possible to do that with css.
Jú Gonçalves
unread,
Oct 10, 2012, 4:28:59 PM10/10/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to html5-game-...@googlegroups.com
You could use a sprite with all bgs for a class .button. But you must set the bg position for all 100 buttons manually.
You cannot do it exactly the way you want with css only.
Joe Thomas
unread,
Oct 10, 2012, 8:01:05 PM10/10/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to html5-game-...@googlegroups.com
When browsers start to support attr() inside of calc() values, this
will be doable.