Different image per style sheet

InsanityOnline

New Member
Messages
30
Reaction score
0
Points
0
Ummm. is there any way I can set an image to change based on a css style sheet?

Like say I wanted my main site logo to be the google logo on style sheet 1, and to be the yahoo logo on style sheet 2. How could I do this?
 
Last edited:

Jesse

Active Member
Messages
1,360
Reaction score
0
Points
36
I think you could use layers in photoshop?
 

Penguin129

New Member
Messages
68
Reaction score
0
Points
0
I'm not sure if you can change an <img> tag's image using css, but if you used a <div> or similar then you can. Let's say that both images are 100x100 pixels,
Code:
<div class="image"></div>
Stylesheet 1
Code:
div.image {
  background-image: url('image1.png');
  height: 100px;
  width: 100px;
}
Stylesheet 2
Code:
div.image {
  background-image: url('image2.png');
  height: 100px;
  width: 100px;
}
Something like that should work.
 

curt15

New Member
Messages
96
Reaction score
0
Points
0
You can use a small block of PHP to randomly select an image.
 

curt15

New Member
Messages
96
Reaction score
0
Points
0
You can make a PHP stylesheet, makes it easier when you want to change colours, but you write it using CSS.
 
Top