|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
vary image with css?
is there any way to change the image that is used in a <img> tag with css?
something like this... Code:
img.image
{
image: url(image.jpg);
width: 100px;
height: 100px;
}
<img class="image" alt="blah" />
|
|
#2
|
|||
|
|||
|
Not really. CSS was developed to seperate content from layout.
CSS being for layout and HTML for content. What are you looking for? A random image display? |
|
#3
|
||||
|
||||
|
no i just wanted to have different stylesheets for my past layouts of my site
|
|
#4
|
||||
|
||||
|
Ok, well what you want to do, is use css image replacement. Basically you make a div with a background image specified as well as height and width. also define a span with {display:none}
in the html put <div id="image"><span>alt text</span></div> the benefit is that you can change the image in the style sheet, without changing the html. the downside is search engines like to see IMG tags, and the lack of any could hurt you in the SERPs Merry Freaking Xmas!!! ![]()
__________________
new jersey web design |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > vary image with css? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|