Stack two tall div elements - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Stack two tall div elements

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">

div{<!--from   w  w w .j a v a  2 s.c  o m-->
   height:800px;
   text-align:center;
}
.blue{
   background:lightblue;
}
.green{
   background:lightgreen;
}
button{
   position:fixed;
   bottom:20px;
}


      </style> 
 </head> 
 <body> 
  <div class="blue"> 
   <h2>header</h2> 
   <button>button</button> 
  </div> 
  <div class="green"> 
   <h2>2nd header</h2> 
  </div>  
 </body>
</html>

Related Tutorials