Creating 4 responsive boxes that cover the whole page - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Creating 4 responsive boxes that cover the whole page

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">
.container {<!--  w w w.  ja  v a 2s .c  o m-->
   display:flex;
   flex-wrap:wrap;
}

.box {
   height:51vh;
   flex-grow:2;
   flex-shrink:2;
   flex-basis:51%;
   min-width:301px;
}

.box1 {
   background:red;
}

.box2 {
   background:blue;
}

.box3 {
   background:green;
}

.box4 {
   background:orange;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="box box1">
     Lor 
   </div> 
   <div class="box box2">
     Lor 
   </div> 
   <div class="box box3">
     Lor 
   </div> 
   <div class="box box4">
     Lor 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials