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 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default Make a div footer? [REP]

    Hey there!
    I'm designing a new layout and I need to know how I can make a div;
    PHP Code:
    <div align="center" id="footer">Footer</div


    Stay right at the bottom of the page, like a footer.
    Let me show you what I mean..



    I need this to be VALID XHTML and CSS, if you can, of course.
    Just post how I can do it, or a tutorial.

    Thanks, Tom.
    Moved by Invent (Forum Moderator) from Design & Development: Please post in the correct forum next time, thanks .
    Last edited by Invent; 12-07-2008 at 11:59 AM.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  2. #2
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TomSpit View Post
    Hey there!
    I'm designing a new layout and I need to know how I can make a div;
    PHP Code:
    <div align="center" id="footer">Footer</div


    Stay right at the bottom of the page, like a footer.
    Let me show you what I mean..



    I need this to be VALID XHTML and CSS, if you can, of course.
    Just post how I can do it, or a tutorial.

    Thanks, Tom.
    CSS:
    Code:
    body {
    font-family: "Trebuchet MS", Arial
    margin: 0px;
    }
    #div1 { 
      width: 100%;
      height: 150px;
    }
    #div2 { 
      width: 100%;
      height: 150px;
    }
    #footer {
    width: 100%;
    height: 250px;
    }
    HTML:
    Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <!-- Recieving HEAD. lmao! -->
    <meta http-equiv="Content-Language" content="en-gb" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    </head>
    <body>
    <div id="div1"></div>
    <div id="div2"></div>
    <div id="footer"></div>
    </body>
    </html>
    Last edited by Independent; 12-07-2008 at 10:54 AM.

  3. #3
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    I think I know what you mean, you want the footer to stay at the bottom no matter how big the page is? So if someone had 1600 x 1200 for instance and the page only covered 500px then you still want the footer to touch the bottom?
    Youmeo - Your Social Reunion
    You can follow development at Twitter & visually at Flickr!

  4. #4
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Klydo View Post
    I think I know what you mean, you want the footer to stay at the bottom no matter how big the page is? So if someone had 1600 x 1200 for instance and the page only covered 500px then you still want the footer to touch the bottom?
    I don't think so, I think he wants it to stretch no matter what the resolution (Which my code does)

  5. #5
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    @ Klydo - YES.
    @ Independant - No, that won't work.
    Last edited by Jahova; 12-07-2008 at 10:59 AM.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  6. #6
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    Okay here's what you do. You set up a wrapper and footer like so;

    HTML Code:
    <!-- wrapper -->
    <div class="wrapper">
    
    <!-- header -->
    <div class="header">
    </div>
    <!-- /header -->
    
    <!-- content -->
    <div class="content">
    </div>
    
    </div>
    <!-- /wrapper -->
    
    <!-- footer -->
    <div class="footer">
    </div>
    <!-- /footer -->
    This now allows us to make it look as if the footer is stretching to the bottom of the page with this CSS;

    Code:
    body {
    background: #eeeeee;
    }
    
    /* wrapper */
    .wrapper {
    width: 100%;
    background: #ffffff;
    overflow: hidden;
    }
    
    /* footer */
    
    .footer {
    width: 100%;
    overflow: hidden;
    }
    Last edited by Klydo; 12-07-2008 at 11:02 AM.
    Youmeo - Your Social Reunion
    You can follow development at Twitter & visually at Flickr!

  7. #7
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TomSpit View Post
    Yes, And @ the other person.
    Nope, that won't work :S.
    HTML
    HTML Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <style>
    body {
    margin: 0;
    }
    #header  {
    background-color: #000478;
    width: 100%;
    height: 300px;
    }
    #content  {
    background-color: #000047;
    width: 100%;
    height: 300px;
    }
    #footer  {
    background-color: #000056;
    width: 100%;
    height: 300px;
    }
    </style>
    </head>
    <body>
    <div id="header"></div>
    <div id="content"></div>
    <div id="footer"></div>
    </body>
    
    </html>

  8. #8
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    @ Klydo - I don't think you understand.
    It needs to be like this;
    http://uploadpicz.com/images/KM9UQGW.png

    So the footer is at the very bottom of the page all the time, no matter what size of the other two divs.
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  9. #9
    Join Date
    Mar 2008
    Posts
    779
    Tokens
    0

    Default

    Quote Originally Posted by TomSpit View Post
    @ Klydo - I don't think you understand.
    It needs to be like this;
    http://uploadpicz.com/images/KM9UQGW.png

    So the footer is at the very bottom of the page all the time, no matter what size of the other two divs.
    It's possible but not cross browser and cross screen resolution friendly. I would tell you how to do it but I've always tried to aviod it so used my solution instead.
    Youmeo - Your Social Reunion
    You can follow development at Twitter & visually at Flickr!

  10. #10
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    HTML (Edit)
    HTML Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <style>
    body {
    margin: 0;
    }
    #header  {
    background-color: #000478;
    width: 100%;
    height: 300px;
    }
    #content  {
    background-color: #000047;
    width: 100%;
    height: 300px;
    }
    #footer  {
    position: absolute;
    bottom: 0;
    background-color: #000056;
    width: 100%;
    height: 300px;
    }
    </style>
    </head>
    <body>
    <div id="header"></div>
    <div id="content"></div>
    <div id="footer"></div>
    </body>
    
    </html>

Page 1 of 2 12 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
  •