HTML CSS examples for CSS Layout:Layout
CSS layout with fixed top and bottom, variable height middle
<!doctype html> <html lang="en"> <head> <title>Lorem ip</title> </head> <!--from www. j av a 2s .co m--> <body> <style> html, body { top:0; width:100%; height:100%; margin:0; padding:0; } .top { position:fixed; top:0; width:100%; height:100px; background:yellow; } .bottom { position:fixed; bottom:0; width:100%; height:100px; background:grey; } .middle { padding-top:100px; padding-bottom:100px } </style> <div class="container"> <div class="top"> Lorem </div> <div class="middle"> Lorem i <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem ip <br>Lorem </div> <div class="bottom"> Lorem ip </div> </div> </body> </html>