IE float/positioning bug?

Discussion in 'HTML' started by Ryan Stewart, Jan 5, 2005.

  1. Ryan Stewart

    Ryan Stewart Guest

    In IE 6.0, I observe that if:
    1) a box has a background color and a border and is relatively
    positioned and,
    2) a child of the box described in 1) is floated, and
    3) the boxes are rendered such that the area of box 2) is within the
    area of box 1),

    then IE renders the child box behind the parent box. The code below
    demonstrates the effect. Removing any one of the background color,
    border, or "position: relative" will cause it to work as expected. Is
    there some other known workaround?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <META HTTP-EQUIV="Content-Type"
    CONTENT="text/html; charset=ISO-8859-1">
    <title>Test</title>
    <style type="text/css">
    #container { background-color: #fff; border: 1px solid
    black;
    position: relative; }
    #floating { float: left; }
    </style>
    </head>
    <body>
    <div id="container">
    <div id="floating">
    This is floated left
    </div>
    <p>
    This is just some text
    </p>
    </div>
    </body>
    </html>
     
    Ryan Stewart, Jan 5, 2005
    #1
    1. Advertising

  2. When something is positioned relative to its parent, the next box will
    position itself first, which is appropriate.
     
    Martin Johansen, Jan 6, 2005
    #2
    1. Advertising

  3. Ryan Stewart

    rf Guest

    "Ryan Stewart" <> wrote

    > In IE 6.0, I observe that if:
    > 1) a box has a background color and a border and is relatively
    > positioned and,
    > 2) a child of the box described in 1) is floated, and
    > 3) the boxes are rendered such that the area of box 2) is within the
    > area of box 1),
    >
    > then IE renders the child box behind the parent box.


    Known bug.

    The workaround it to specify position: relative; for the floated box.

    --
    Cheers
    Richard.
     
    rf, Jan 6, 2005
    #3
  4. Ryan Stewart

    Ryan Stewart Guest

    "Martin Johansen" <> wrote in message
    news:UF2Dd.2935$...
    > When something is positioned relative to its parent, the next box will
    > position itself first, which is appropriate.

    Not sure what you're talking about, but Richard gave me a solution.
     
    Ryan Stewart, Jan 6, 2005
    #4
  5. Ryan Stewart

    Ryan Stewart Guest

    "rf" <rf@.invalid> wrote in message
    news:pZ2Dd.105985$...
    > Known bug.
    >
    > The workaround it to specify position: relative; for the floated box.
    >

    Thanks a bunch. And sorry for the formatting of that post. I posted it with
    Google, and it removed a lot of spacing.
     
    Ryan Stewart, Jan 6, 2005
    #5
    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. Andy
    Replies:
    7
    Views:
    6,326
    Roedy Green
    May 10, 2004
  2. Jim West
    Replies:
    4
    Views:
    1,507
    Jeff Schwab
    Jan 16, 2004
  3. daniel
    Replies:
    1
    Views:
    2,131
    Tom St Denis
    Jun 24, 2003
  4. bd
    Replies:
    0
    Views:
    663
  5. Carsten Fuchs
    Replies:
    45
    Views:
    1,648
    James Kanze
    Oct 8, 2009
Loading...

Share This Page