Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

CSS Footer...

  • 20-10-2006 05:29PM
    #1
    Closed Accounts Posts: 8,866 ✭✭✭


    Hey guys, I'm hoping someone can help here but being new to CSS I'm not sure it will be possible! I have a page layout in the format of a full width header, a thin left column, main content in the middle and a thin right column, I would like to be able to stick a footer on too, but I cant get it to stick to the bottom of the page depending on the length of the page i.e. whether it scrolls or not. Here's the CSS:
    #header{
     position:relative; 
     width:100%;
    }
    
    #navbartop{
     position:relative; 
     top:0;
     width:100%;
    } 
     
    #leftcol{
     top:40px; 
     float:left;
     position:relative; 
     }
     
    #maincol{
     top:70px;
     position: relative;
     }
    
     #rightcol{ 
     top:40px;
     float:right;
     position:relative; 
     
     }
    


Comments

  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m




  • Closed Accounts Posts: 70 ✭✭vito


    Add

    #footer {
    clear: both;
    }

    to the CSS and you should be ready to go.

    your using floats to get the left, right and center columns.


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    It seems a combination of both would be best but I just cant get it.

    The div layout is like this:

    [html]
    <div id="header">

    <div id="navbar">...</div>
    ...
    </div>

    <div id="leftcol">...</div>

    <div id="rightcol">...</div>

    <div id="maincol" align="center">...(usually contains tables)...</div>

    <div id="footer" align="center">...</div>
    [/html]

    Nav bar looks like
    #navbartop{
     position:relative; 
     top:0;
     width:100%;
    }
    


Advertisement