March 1st, 2003, 02:47 PM
Turn a picture into a link using CSS
Greetings... I just joined this forum, it looks muy helpful. I have a small question:
I have a picture that I put onto my site (well, my neopets userlookup --feels childish--) with CSS. The code I used was (hopefully this will show up, I'm not sure if it will):
<i class="anypic1"> </i>
I'd like to be able to make that picture into a link. Is it possible to do that somehow?
March 1st, 2003, 02:57 PM
I'm a bit confused by your coding.
The <i> tag is for Italic text.
The CSS you have assigns a background URL to the <i> tag.
The basic way to assign a link to an image is this
<a href="http://www.url.com"><img src="image.jpg" alt="my image"></a>
March 1st, 2003, 06:34 PM
see, that's the thing: that's HTML, isn't it? or am I just extremely confused? I know that code well enough, but if I use it, I can't position the picture where I want it, becaue that requires CSS. this is frustrating...
March 1st, 2003, 06:42 PM
CSS & HTML are to be used together
You can add CSS to any element by using the style attribute.
<a href="http://www.url.com"><img src="image.jpg" alt="my image" style="height:600;width:800;position:absolute;top:0;left:0"></a>