user2710234
user2710234

Reputation: 3225

make css footer stay under content

I have this css:

.lh_container {
    width:960px;
    margin:0 auto 40px auto;
    position:relative;
}

.lh_footer {
    position:absolute;
    bottom:0;
    width:100%;
    height:60px;            /* Height of the footer */
    background:#6cf;
}

.lh_footer-container {
    display:block;
    width:80%;
    margin: 0 auto;
    overflow: hidden;
}

and this HTML:

<div class="lh_container">

<div class="lh_footer">
    <div class="lh_footer-container">

    <div class="lh_footer_text">
    &copy; Copyright <?php echo date("Y"); ?>
    </div>

    </div>
</div>

</div><!-- container -->

but the footer will not stay at the bottom of the page - how can i achieve this?

Upvotes: 0

Views: 1020

Answers (1)

elkirkmo
elkirkmo

Reputation: 80

Use fixed instead of absolute.

http://jsfiddle.net/pnLyh/

Upvotes: 3

Related Questions