Results 1 to 6 of 6

Thread: CSS for a auto stretching footer?

  1. #1
    Join Date
    Apr 2010
    Posts
    89
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default CSS for a auto stretching footer?

    Hi all... its been awhile but I'm working on a new page and I need help with my footer. I have a footer with a set height and then I have a div below it. I want the div below it to be auto stretching vertically until it reaches the footer with the set div. What would my css be for this? I tried this below:

    CSS
    Code:
    #footer{
    background-color:black;
    width:100%;
    height:255px;
    }
    
    .footerspacer{
    bottom:0
    position:absolute;
    width:100%;
    height:100%;
    }
    HTML
    Code:
    <div id="footer"></div>
    <div class="footerspacer"></div>
    But what ended up happening was that the stretching part stretched to the very top of the page, covering all of the content. How can I get it to just stretch up to the footer div?

  2. #2
    Join Date
    Dec 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think I fixed it. I just put a set 221px in place of my 75% height.

  3. #3
    Join Date
    Apr 2010
    Posts
    89
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    What 75% height?

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    perhaps this would be what you're looking for?

  5. #5
    Join Date
    Apr 2010
    Posts
    89
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    I thought about that Traq, but here is what I want to happen:



    On the left is what happens when you view the page, and I want the space below the footer to fill up with the color black.

  6. #6
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    just make your <body> background solid black. Put the actual background (blue/grey waves) inside a wrapper div.

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
  •