www.webdeveloper.com
Results 1 to 9 of 9

Thread: Div Float question

  1. #1
    Join Date
    Mar 2004
    Location
    Iqaluit
    Posts
    5

    Div Float question

    The following page leaves an 1 pixel gap between the 2nd & 3rd <div> Other than changing the body background color, is there a way to get rid of it

    Thanks

    Frank Polan

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    </head>

    <body style="background-color: Red;">
    <div style="height: 100%;background-color: Lime; width: 30%; float: left;"></div>
    <div style="height: 20%;background-color: orange; width: 40%; float: left; border: thin solid Black;">
    <p>one pixel problem -> </p>
    </div>
    <div style="height: 100%;background-color: Lime; "></div>

    </body>
    </html>

  2. #2
    Join Date
    Jul 2004
    Location
    Sendai, Japan
    Posts
    1,273
    First, use a complete DTD...
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " http://www.w3.org/TR/html4/strict.dtd ">
    Then, do this :
    Code:
    p {
    margin:0;
    }
    I think that'll fix your problem (maybe).

  3. #3
    Join Date
    Mar 2004
    Location
    Iqaluit
    Posts
    5
    BonRouge,

    Sorry, that doesn't do it. I did manage to get rid of it by adding Float: left; width: 30%; to the 3rd div, but then that causes resizing problems.
    I guess I'll just change the body background color

    Thanks

    Frank Polan

  4. #4
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,774

  5. #5
    Join Date
    Mar 2004
    Location
    Iqaluit
    Posts
    5
    Sorry, I should have said - IE6

    Thanks

    Frank Polan

  6. #6
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,774

  7. #7
    Join Date
    Mar 2004
    Location
    Iqaluit
    Posts
    5
    all I can say is WOW!!!!!!!!!!!!!!!!!!

    Thanks for the link

    Frank Polan

  8. #8
    Join Date
    Mar 2005
    Location
    Washington, USA
    Posts
    379
    Instead of border: thin solid Black;, use border: 1px solid #000;.

  9. #9
    Join Date
    Mar 2004
    Location
    Iqaluit
    Posts
    5
    I'll try it
    Thanks
    Frank Polan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles