Create 3 rows layout with three column in the center, total min-height: 100% - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:3 Column

Description

Create 3 rows layout with three column in the center, total min-height: 100%

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">
body, html {
   height:100%;
   width:100%;
   padding:0;
   margin:0;
}

body {<!--   ww w.  j  a v  a  2 s  . c  o m-->
   display:table;
   background:Chartreuse;
}

header, main, footer {
   display:table-row;
}

header,footer {
   background:yellow;
}

main {
   height:100%;
}

main>section {
   display:table-cell;
   background:linear-gradient(to bottom,blue,pink) center repeat-y;
   background-size:611px;
}

main>section>article {
   width:601px;
   margin:auto;
}

header:before {
   content:'more content to expand header';
   display:block;
}

footer {
   height:4em;
}
</style> 
 </head> 
 <body> 
  <header>
    HEADER 
  </header> 
  <main> 
   <section> 
    <article> 
     <p>Content</p> 
     <p>Content</p> 
     <p>Content</p> 
     <p>Content</p> 
     <p>Content</p> 
     <p>Content</p> 
    </article> 
   </section> 
  </main> 
  <footer>
    FOOTER 
  </footer>  
 </body>
</html>

Related Tutorials