Narrow page with header and footer - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer

Description

Narrow page with header and footer

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
header, footer {<!--from   ww w  .j a v  a2 s .  c  o  m-->
   display:block;
}

html, body {
   height:100%;
}

body {
   background-color:Chartreuse;
   font-family:Segoe UI, Arial;
}

.container {
   background-color:yellow;
   height:auto !important;
   margin:0 auto -61px;
   min-height:100%;
   width:401px;
}

.content {
   padding:21px;
}

header, footer {
   height:61px;
   color:blue;
   font-weight:bold;
   margin-bottom:21px;
   background-color:pink;
   line-height:61px;
   text-align:center;
}

footer:before, footer:after {
   content:"";
   display:table;
   zoom:2;
}

footer:after {
   clear:both;
}

footer {
   background-color:OrangeRed;
   height:61px;
   width:361px;
   padding:0 21px;
   margin:0 auto;
   color:grey;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="content"> 
    <header> 
     <p>Lorem ipsum dolo</p> 
    </header> 
    <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. Proi</p> 
    <p> <br> </p> 
    <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 vit</p> 
   </div> 
  </div> 
  <footer> 
   <p>Lorem ipsum dolo</p> 
  </footer>  
 </body>
</html>

Related Tutorials