2 replies [Last post]
brucelu
brucelu's picture
Offline
Regular
Vancouver
Last seen: 16 years 16 weeks ago
Vancouver
Timezone: GMT-8
Joined: 2003-07-04
Posts: 12
Points: 0

I'm building some skins, both skins have some graphical buttons.

I'm thinking it'd be great if these buttons could be dished out via CSS, so when i swap skins, i could also swap the buttons.

I can't think of a way to do it, except to use the background property in css, but then how do I apply a link to a div tag with a background image?

Is there any other way I can do this? or will i need to have the images written out dynamically from the back-end?

Thanks,

BruceLu

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 5 days 22 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

css controlled images problem

Hi BruceLu,
Try using links instead of divs.

a{background-image:url(smOne.jpg);}
a:hover{background-image:url(smTwo.jpg);}

Of course you'll have to test, it works on Netscape7 and IE6 on windows.

brucelu
brucelu's picture
Offline
Regular
Vancouver
Last seen: 16 years 16 weeks ago
Vancouver
Timezone: GMT-8
Joined: 2003-07-04
Posts: 12
Points: 0

css controlled images problem

Ah that's quite creative - i have a feeling it might act weird on some browsers though Wink but i'll give it a run through.

Thanks!