You are here: Re: vertically align absolutely positioned div elements « HTML « IT news, forums, messages
Re: vertically align absolutely positioned div elements

Posted by Mitja Trampus on 12/08/65 11:35

Guybrush Threepwood wrote:
> On http://users.skynet.be/am036990/test.html I have 2 div elements
> underneath each other. But when I lower the font size (in Firefox: <ctrl>+-),
> the lowest box slides in front of the upper box. How can I avoid this?

No idea why it does what it does, but the fix is easy: don't
use absolute positioning with #menu and #searchbox, but
rather on a new containing div#foo:
<div id="foo"> <-- absolutely postioned
<div id="menu">...</div>
<div id="searchbox>...</div> <-- add some margin-top
</div>

This is even better than the original solution because it
avoids the explicit top:18em on #searchbox, which would have
to be changed every time you change the contents of #menu.

 

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

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