Previous Message
Next Message

Getting rid of the line under a hyperlinked image

Sent by Philippe Wittenbergh on 30 March 2006 09:09

On Mar 30, 2006, at 5:05 PM, Joanne wrote:

>>> I have image and a text hyperlinked together. In IE only the text is
> underlined, but in Firefox & Opera, the image is too. How do I get  
> rid of
> it?
>> Try img { border: none; }
> That's already in my css code. It doesn't stop the hyperlink  
> underline on an
> image in Firefox or Opera..

The image is an inline element, and as such, rests on the baseline.  
The text-decoration goes under the baseline. You can get away with it  
in IE, because that browsers puts images *under* the baseline  
(actually, it doesn't really know where it puts the images, it mostly  
depends on the weather, I think....).
If your html code is something like this:
<a href="">some text <img src="myimage.png"></a>

you can play with the vertical align property
a img {vertical-align: text-bottom} /* or bottom, or middle */

Philippe Wittenbergh

css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: