vertically align absolutely positioned div elements

Discussion in 'HTML' started by Guybrush Threepwood, Dec 14, 2005.

  1. 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?


    --
    "Don't worry about people stealing your ideas. If your ideas are any
    good, you'll have to ram them down people's throats."
    -- Howard Aiken
    Guybrush Threepwood, Dec 14, 2005
    #1
    1. Advertising

  2. 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.
    Mitja Trampus, Dec 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John A Grandy
    Replies:
    3
    Views:
    322
    darrel
    Jun 15, 2004
  2. Replies:
    13
    Views:
    945
    =?ISO-8859-1?Q?G=E9rard_Talbot?=
    May 5, 2006
  3. jonefer

    Absolutely Positioned controls and tables

    jonefer, Aug 23, 2007, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    700
    jonefer
    Aug 23, 2007
  4. Replies:
    0
    Views:
    113
  5. Hoss
    Replies:
    0
    Views:
    88
Loading...

Share This Page