Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: 100% height not quite working

  1. #1
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 100% height not quite working

    Alright. On this page I'm making I have a bar 26px wide with a background color on the very left of the page. I need this to span all the way down the page, as tall as the content is on any page. So I simply did a

    <div class="leftsidebar"></div>

    and the css is

    .leftsidebar {
    background-image:url(leftbar_bg.jpg);
    background-repeat: repeat-y;
    height: 100%;
    width: 26px;
    float: left;
    position: absolute;
    z-index: 2;
    }

    But... it doesn't span all the way down the page. It stops short. I added a SS of what the page looks like.


  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    is there a table in this page...also you could try 110&#37;

  3. #3
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No tables, just all divs. I'll try 110&#37;

  4. #4
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm. That didn't seem to help.

  5. #5
    Join Date
    Feb 2007
    Posts
    293
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    A couple of things to try. First, add height to your body and html:

    html {height: 100%;}
    body{height: 100%;}

    Also, the div will be 100% height of its containing div, so make sure it isn't in another div with a shorter height.

    Finally, if that doesn't work, check your doctype. You might be better with something like

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  6. #6
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried all of that, and none of it seems to work. I have the div by itself, not contained in anything. I added those styles and changed the doc type and it still doesn't seem to do it.

    I got someone else to look at my page and they said they couldn't see the black bar at all except for a very small bit of it at the very top... weird.

  7. #7
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    In addition to
    Code:
    html {height:100&#37;;}
    body {height:100%;}
    try
    Code:
    * {padding:0px; margin:0px;}
    I've never tried the above stuff before, but I have encountered the same problem you have, and the height/width percentages vary from browser to browser.

  8. #8
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the help so far, but that didn't work either.

  9. #9
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Anyone have any other ideas? Am I correct in having it in its own div instead of being contained in one?

    I don't really have a container div or a master div... everything is pretty much on its own.

  10. #10
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here's another screenshot of a different page. As you can see on this one it doesn't even come close to the bottom of where the products are.

    Anyone have any other ideas?


Bookmarks

Posting Permissions

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