-
CSS <img> tag
Hi-
I would like to have something similar to this:
img{ image-source: url(something.gif);}
So that my images are all pointing to something.gif
So far I haven't found anything with css that will allow me to change the source of the img tags.
Can anyone point me in the right direction?
-
thats not possible with CSS
-
AFAIK this is not possible in CSS. But you can use something like this: Instead of <img.. you would have <div class='pic'></div> in your html code. And in your css you would have:
div.pic {background:url('../pictures/thesame.gif' no-repeat top left;
height:50px;
width:50px;}
Of course the height and the width should be set to the height and width of you picutre. In this case you can have as many as you want divs with class pic and all of them with the same picture inside. Other thing is that in this solution no picutre would be seen without css. If this is for your case advantage or disadvanatage is up to you:). Good luck.
-
soda - you don't mean an image as a background do you?
If you do then use
{background-image: url("/file path/something.gif")}
or do you mean images seperated by white space - in which case I'd try something along the lines of Sun's suggestion.