Make 3 column css layout with sticky footer with columns 100% height - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer stick to bottom

Description

Make 3 column css layout with sticky footer with columns 100% height

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">
html {<!--  w  w w  . j  a v  a2s . c o m-->
   min-height:100%;
}

body {
   min-width:631px;
}

html, body {
   height:100%;
   width:100%;
}

#container
 {
   display:table;
   width:100%;
   height:100%;
   margin:-31px 0 -100px;
   padding:31px 0 100px;
   -moz-box-sizing:border-box;
   box-sizing:border-box;
}

#container .column {
   display:table-cell;
}

#center {
   padding:11px 21px;
}

#left {
   width:181px;
   padding:0 11px;
}

#right {
   width:131px;
   padding:0 11px;
}

#header
 {
   height:31px;
}

#footer {
   height:100px;
   width:100%;
}

* html #left {
   left:151px;
}

body {
   margin:0;
   padding:0;
   background:blue;
}

#header, #footer {
   font-size:large;
   text-align:center;
   padding:0.4em 0;
   -moz-box-sizing:border-box;
   box-sizing:border-box;
   background:Chartreuse;
}

#left {
   background:yellow;
}

#center {
   background:blue;
}

#right {
   background:pink;
}

#container .column {
   padding-top:2em;
   text-align:justify;
}
</style> 
 </head> 
 <body> 
  <div id="header">
    This is the header. 
  </div> 
  <div id="container"> 
   <div id="left" class="column"> 
    <h2>This is the left sidebar.</h2> 
    <p>Lorem ipsum dolor sit amet</p> 
   </div> 
   <div id="center" class="column"> 
    <h1>This is the main content.</h1> 
    <p>Lorem ipsum dolor sit amet</p> 
   </div> 
   <div id="right" class="column"> 
    <h2>This is the right sidebar.</h2> 
    <p>Lorem ipsum dol</p> 
   </div> 
  </div> 
  <div id="footer">
    This is the footer. 
  </div>  
 </body>
</html>

Related Tutorials