Forum Moderators: not2easy

Message Too Old, No Replies

Proper image linking code for CSS

         

hgerman

10:39 pm on Oct 1, 2007 (gmt 0)

10+ Year Member



Hi, all. I need help with what I'm sure will be an easy task for most of you here. I'm new to CSS and I've got the following code working beautifully and now I need to make the image I specify below linkable. In short, I need http://example.com/image.jpg to link to http://example.com/index.htm. What is the extra piece of code that I need to add?

Above the </head>, I have:

<style type="text/css" media="screen">
body
{
image:
url('http://example.com/image.jpg')
}

body {margin:0px; padding:0px;}
img.y
{
position:absolute;
left:50%;
width:40px;
margin-top:-354px;
margin-left:252px;
padding:15px;
z-index:1000
}
</style>

and below the <body>, I have:

<img class="y" src=http://example.com/image.jpg width="198" height="26" alt="menu">

[edited by: encyclo at 10:49 pm (utc) on Oct. 1, 2007]
[edit reason] switched to example.com [/edit]

encyclo

10:51 pm on Oct 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The link is HTML, not CSS. CSS is for style, HTML (and Javascript) is for function. :)

<a href="http://example.com/"><img class="y" src=http://example.com/image.jpg width="198" height="26" alt="menu"></a>

hgerman

7:48 pm on Oct 2, 2007 (gmt 0)

10+ Year Member



Thanks!