You are here: Re: A few questions and a critique request « HTML « IT news, forums, messages
Re: A few questions and a critique request

Posted by rf on 01/15/10 11:30

sagejoshua wrote:

> I'm pretty sure that negative margins are far more cross-browser
> compatible (and suprisingly bugless) than auto margins. Netscape 4.x
> even renders negative margins correctly.

Using negative margins for centring is a Very Bad Mistake. If the viewport
is less than the width of the centred content then the content disappears
off the left hand of the viewport, never to be seen again. This content is
not accessible *at all*, the horizontal scroll bar will not let you to go
there.

Try it for yourself here:
http://www.snakebirdstudios.com/

Narrow the window to 640 pixels wide (not an uncommon size). Part of your
*navigation*, of all things, disappears.

To centre content use auto margins. For those browsers that do not support
it correctly (IE 5.x and IE6 in quirks mode) then use a suitable hack
(text-align: center;, hidden from other browsers, is one)

--
Cheers
Richard.

 

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

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