Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default Making a div stay at the bottom of the page (not bottom of browser window)

    Hi, basically I have a div that is my footer on a page. I want it to stay at the bottom of the page, so if you have a big screen then you'll see the content, and the footer will be at the bottom and if you have a small screen you'll see the content, have to scroll down and see the footer.

    The way I was doing the footer was along the lines of...

    Code:
    .footer {
    position:absolute;
    bottom: 0;
    }
    That makes the footer stay at the bottom of the page, which is good, but it also makes it stay at the bottom of the browser window, so if you have a small screen then it covers the content...

    So I tried...

    Code:
    .footer {
    position:static;
    bottom: 0;
    }
    That doesn't stick to the bottom of the page or browser window - I want it to stick to the bottom of the page but not the window...

    Any help, please? An example of what I want: http://ryanfait.com/ like that footer.

  2. #2
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    5,769
    Tokens
    1,249
    Habbo
    Beneficial

    Latest Awards:

    Default

    position: relative; should do the trick.
    what is fetch gretchen?

  3. #3
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    Doesn't 'bottom: 0;' make it go to the bottom of the broswer anyway?

    You need to set an actual distance from the top of the page (for example, if your site had a height of 1000px, then set it to 1020px etc.)

    Correct me if i'm wrong!

    EDIT; Wait, ignore that, just make a container with a set height, and put the footer div inside that.
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  4. #4
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Homosexuality View Post
    position: relative; should do the trick.
    Nope, does the same as static in this instance.

    Quote Originally Posted by Biohazard View Post
    Doesn't 'bottom: 0;' make it go to the bottom of the broswer anyway?

    You need to set an actual distance from the top of the page (for example, if your site had a height of 1000px, then set it to 1020px etc.)

    Correct me if i'm wrong!

    EDIT; Wait, ignore that, just make a container with a set height, and put the footer div inside that.
    The thing is the height is going to change as more or less content is entered... I'll try the second suggestion in a minute. Cheers Jack, how's IMG Upload going?

  5. #5
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    5,769
    Tokens
    1,249
    Habbo
    Beneficial

    Latest Awards:

    Default

    Just set the height to a specific size, e.g. 'height: 100px;'
    what is fetch gretchen?

  6. #6
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    Quote Originally Posted by Hitman View Post
    Nope, does the same as static in this instance.


    The thing is the height is going to change as more or less content is entered... I'll try the second suggestion in a minute. Cheers Jack, how's IMG Upload going?
    No problem.

    And it's going okay thanks, but my internet has been broken the past couple of weeks, and is going to cost a LOT for it to be fixed, so it's probably going to be a while before I can finish it.
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  7. #7
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Homosexuality View Post
    Just set the height to a specific size, e.g. 'height: 100px;'
    The height of the footer is (didn't show full code, my bad).

    Quote Originally Posted by Biohazard View Post
    No problem.

    And it's going okay thanks, but my internet has been broken the past couple of weeks, and is going to cost a LOT for it to be fixed, so it's probably going to be a while before I can finish it.
    Not working. Tried relative and static too...

    Code:
    .footercont {
        width:100%;
        position: fixed;
        height:73px;
        bottom: 0;
    }
    .footer {
        background-image:url(images/footerbg.png);
        background-repeat:repeat-x;
        width:100%;
        height:73px;
    }

  8. #8
    Join Date
    Dec 2005
    Posts
    6,228
    Tokens
    1,145

    Latest Awards:

    Default

    Quote Originally Posted by Hitman View Post
    The height of the footer is (didn't show full code, my bad).



    Not working. Tried relative and static too...

    Code:
    .footercont {
        width:100%;
        position: fixed;
        height:73px;
        bottom: 0;
    }
    .footer {
        background-image:url(images/footerbg.png);
        background-repeat:repeat-x;
        width:100%;
        height:73px;
    }

    Code:
    .footercont {
        width:100%;
        position: fixed;
        height:1000px;
        top: 0;
    }
    .footer {
        background-image:url(images/footerbg.png);
        background-repeat:repeat-x;
        width:100%;
        height:73px;
    }
    Try that.

    As you're working from the bottom, it adds it to the bottom of the browser - upwards.
    i'm out of touch, i'm out of love
    i'll pick you up when you're getting down
    and out of all these things i've done
    i think i love you better now

  9. #9
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Biohazard View Post
    Code:
    .footercont {
        width:100%;
        position: fixed;
        height:1000px;
        top: 0;
    }
    .footer {
        background-image:url(images/footerbg.png);
        background-repeat:repeat-x;
        width:100%;
        height:73px;
    }
    Try that.

    As you're working from the bottom, it adds it to the bottom of the browser - upwards.
    That wont work. top:0 will make it stick to the top, I did test it just in case and it did.

  10. #10
    Join Date
    Jul 2008
    Posts
    5,289
    Tokens
    0

    Latest Awards:

    Default

    does

    Code:
    top: 100%;
    margin-top: -100px; (half of your div height)
    position: absolute;
    make it stay at the bottom, in view, even if you scroll down?

    like facebooks bottom bar?

Page 1 of 3 123 LastLast

Posting Permissions

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