HTML CSS examples for CSS Layout:Box
extend a CSS/HTML content box to the bottom of browser/viewport window
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> html, body { margin:0; padding:0; border:3px solid Chartreuse; } html, body, #MainBody, #ContentWrapper { height:100%; min-height:100%; box-sizing:border-box; -moz-box-sizing:border-box; } #MainBody {<!--from ww w . j a v a2 s. c om--> margin:0; padding:0; border:3px solid yellow; } #TopHeader { width:100%; height:51px; background-color:blue; padding:11px; color:pink; float:left; margin-bottom:51px; } #ContentWrapper { margin:0; padding:21px 21px 0 21px; margin:0px 11px 0 11px; border:3px solid OrangeRed; } </style> </head> <body> <div id="MainBody"> <div id="TopHeader"> Lorem ipsum dol </div> <div id="ContentWrapper"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae te </div> </div> </body> </html>