You are here: Re: Someone help a CSS newbie: why is there extra bottom padding on image? « HTML « IT news, forums, messages
Re: Someone help a CSS newbie: why is there extra bottom padding on image?

Posted by Ben C on 07/04/07 18:31

On 2007-07-04, steve <steve@nospamtoday.thanks> wrote:
> Hi,
>
> I've got a simple problem - I'm trying to position a logo in CSS with a 1px
> border that has a padding of 1px, and a 1px margin. In IE6 it works fine,
> but in Opera 9 or Firefox 2 the bottom border seems to have some extra
> padding applied. The problem only occurs if the DOCTYPE declaration is in
> place, without one everything is fine.

Add div#logo img { display: block; }

The gap is because the img is inline, and so sits on the baseline, with
a gap underneath for descenders in the current font. But not in quirks
mode. But don't use quirks mode, instead make the img a block.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация