Thursday, April 25, 2013

HTML CSS Sticky footer

If you are constantly developing websites, one thing that you may face constantly is sticky footer. Here it is:

Sticky Footer CSS

html {
height: 100%;
min-height: 100%;
}


#body_wrapper {
min-height: 100%;
height: auto !important;
margin-bottom: -150px;
}


#footer {
background: #000000;
        color: #fffffff;
height: 150px;
}

You will want to change the height of you footer (150px above).

Sticky Footer HTML

<html>
<body>
<div id="dbody_wrapper">body</div> 
<div id="footer">footer</div>
</body>
</html>

No comments:

Post a Comment