Friday, September 25, 2009

How to stick the footer to the buttom of the page

As usual there are more roads leading to Mekka. This is one way of getting the same result without any scripts. It uses a simple cascading stylesheet:


div#footer
{
   clear: both;
   padding: .5em 1em;
   border-top: 0px solid #ccc;
   text-align: center;
   padding: 0 0 0 0;
   margin: -20px 0 0 -100px;
   position: fixed;
   left : 50%;
   top: 100%;
}

1 comment:

Asghar Panahy said...

There is a problem when page is scrolling up. The footer should remain in its position :-(