Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2007
    Location
    Canterbury, Kent (immigrant, of course :)
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    CSS: "height: 100%" leaves unwanted space at the top

    When I set my CSS "wrapper" (which will contain several sections) to a width and height of 100%, there is a white space at the top. That space is made up for, but of course that goes "below screen" and one has to scroll.

    Here's the problem:
    http://www.indigetesdii.org/idnew/index.php

    I can't see a problem with the CSS code myself, but I reckon this is not how 100% is normally viewed, so I'm fairly sure I'm missing something :/

    Thanks in advance.

  • #2
    Regular Coder
    Join Date
    Feb 2007
    Location
    Seattle
    Posts
    153
    Thanks
    5
    Thanked 9 Times in 9 Posts
    Prior to your wrapper div you have an empty table that has a height of 15%. If you get rid of that your space goes away.

    Code:
    <body>
    <table width="100%" height="15%" border="0">
    <tbody>
    <tr>
    <td>
    <p/>
    </td>
    </tr>
    </tbody>
    </table>
    Also, you need to get rid of the default margins applied (differently) by various browsers.
    Code:
    * {margin:0; padding:0}
    will do that for you.

    Gary

  • Users who have thanked garydarling for this post:

    Khensu (09-29-2007)

  • #3
    New Coder
    Join Date
    Jan 2007
    Location
    Canterbury, Kent (immigrant, of course :)
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Oh god... that's a remainder from the current site, which used pixels to define the width and height, and to make it work properly in IE I had to add that table. How stupid do I feel now! Never recycle your old code eh

    I'll add the 0 margins as well... Thanks for the swift reply!


  •  

    Posting Permissions

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