HTML CSS examples for CSS Widget:Footer aligned bottom
Make a Footer Stick to the Bottom with a fixed Navigation at the Top
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> * {<!-- w w w .j ava 2s . co m--> margin:0; } html, body { height:100%; } header, footer { display:block; } header { height:31px; background-color:Chartreuse; color:yellow; } .navbar-fixed { left:0; position:fixed; right:0; top:0; z-index:1031; } .push { height:41px; } .push:before, .push:after { display:table; content:""; zoom:2; } .push:after { clear:both; } .content { position:relative; min-height:100%; height:auto !important; margin:0 auto -31px; } .clearfooter { clear:both; height:31px; } footer { height:31px; position:relative; background-color:blue; } </style> </head> <body> <header class="navbar navbar-fixed"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed</p> </header> <div class="content"> <div class="push"> </div> <div class="container"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semper sit amet purus quis ornare. Quisque lobortis neque vitae tempor iaculis. Aliquam erat volutpat. Mauris tincidunt eget lacus eget pulvinar. Suspendisse potenti. Maecenas blandit tempus metus, eu ornare eros egestas sit amet. Cras et arcu eget massa porta porttitor eget ac neque. Lorem ipsum dolor sit amet, consectetur adipis</p> </div> </div> <footer> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed</p> </footer> </body> </html>