Previous Message
Next Message

Can I put a link on an image in CSS?

Sent by Els on 18 February 2006 15:03


Peter Snow Cao wrote:
> Els wrote:
>
>> No, you have to add the link code <a href="... > to the HTML.
>
> So I do have to take the image out of the CSS and put it in
> HTML on each web page, or is the a way to map the area where
> the image will be with a link?

Ah, didn't get you the first time. You can have an invisible gif 
in the <a> element, or even just a &nbsp; if you set the <a> 
element to display:block;. Just position this link with 
position:absolute; over the background image that's there. That 
way it won't mess up any of the rest of page layout.
I'd choose a gif over an &nbsp; though, so you can make use of 
the alt text for people who surf without images, such as Lynx  or 
screenreader users. They wouldn't be able to 'see' the link if it 
were just a blown up &nbsp;.


-- 
Els
http://locusmeus.com/
http://locusoptimus.com/

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: