position div's for stack - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

position div's for stack

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">
* {<!--from  ww w  . java  2  s. c  om-->
   box-sizing:border-box;
   white-space:nowrap;
}

div {
   padding:0;
   margin:0;
}

.div1 {
   width:21%;
   height:100%;
   background-color:Chartreuse;
   min-height:100vh;
   display:inline-block;
   word-wrap:break-word;
   overflow:hidden;
   white-space:normal;
}

.wrapper {
   width:81%;
   min-height:100vh;
   display:inline-block;
}

.div2,.div3 {
   width:100%;
   min-height:51vh;
   background-color:yellow;
   word-wrap:break-word;
   overflow:hidden;
   white-space:normal;
}

.div3 {
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <div class="div1">
    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. Proin luctus facilisis volutpat. Ut semper s 
  </div> 
  <div class="wrapper"> 
   <div class="div2">
     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. Proin luctus facilisis volutpat. Ut semper s 
   </div> 
   <div class="div3"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials