www.webdeveloper.com
Results 1 to 5 of 5

Thread: 100% width div in IE5.5

  1. #1
    Join Date
    Apr 2003
    Posts
    3

    100% width div in IE5.5

    Hi,
    This may have been asked before, but I've searched the web and usenet and not found an obvious answer...

    I have the following (cut-down) html :

    -----------------

    <html>
    <head>
    <title>Morgans Website</title>
    <style type="text/css">

    #inner3 {
    position: absolute;
    top: 50%;
    left: 0px;
    width: 100%;
    border-top: 1px solid #BB88EE;
    border-bottom: 1px solid #BB88EE;
    }

    </style>
    </head>
    <body bgcolor="white">

    <div id="inner3">
    Hello
    </div>

    </body>
    </html>

    -----------------


    In Mozilla & Konqueror it displays as I expect - 100% of the screen width, but in IE5.5 (the only one I have here) and Opera 6 it seems to be using only about 95% of the screen width.

    Does anyone know if there's a work-around for this?

    Billy.

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    It has to do with the scrollbar. IE always leaves room for it unless you tell the body that you never want to scroll.

    The problem stated simply, is how they define "100% of what". It is supposed to be 100% of the container. A handy illustration can be found at http://msdn.microsoft.com/workshop/A.../measuring.asp

  3. #3
    Join Date
    Apr 2003
    Posts
    3
    I've tried setting the body with an "overflow: hidden", but it makes no odds..., no scrollbar, but still a gap at the right of the screen...

    Or am I missing something else?

  4. #4
    Join Date
    Nov 2002
    Posts
    4,473
    Try adding
    Code:
    <style>
    body {overflow: hidden; margin: 0px}
    </style>

  5. #5
    Join Date
    Apr 2003
    Posts
    3
    It works!

    Hoorah for you! :-)

    Thanks for the help :-)

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