tags:

views:

64

answers:

3

I have a div which I am using as a footer to display some content. I have put the style as:

.pageFooter{
    position:absolute;
    bottom:0px;
    width:100%;
    height:25px;
    background:#e6e6e6;
}

This style works well when there is not content in the body of page. But when I populate the page with content, say datagrid, the div is overlaps data in datagrid. What changes should I make to the style to let the div be at the bottom always. I am using IE* to view the pages.

+1  A: 
body, html {
    height:100%;
    margin-bottom:25px;
}
Charlie Somerville
Nothing seems to work for IE8.
Ashish
Is it a solution? Lol
Happy
+1  A: 

This may help you http://www.cssstickyfooter.com/

Barry
Nothing seems to work for IE8.
Ashish
CSS Sticky Footer does work for IE8http://www.cssstickyfooter.com/images/ie-8-win-xp.png
Barry
FooterStickAlt, one of the first to describe this, still does the trick: http://www.themaninblue.com/writing/perspective/2005/08/29/.
Alec
A: 

The best method:

html, body { height: 100%; }

.wrapper {
    min-height: 100%;
    _height: 100%; /* hack for IE6 */
    margin-bottom: -100px; /* height of the footer */
}

.wrapper-inner { padding-bottom: 100px; }

.footer { position: relative; height: 100px; overflow: hidden; }


<body>
<div class="wrapper">
    <div class="wrapper-inner">
        Content
    </div>    
</div>
<div class="footer">
    Footer
</div>
</body>

Doctype should be strict or transitional xhtml.

Happy