Centering two boxes on resize - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Centering two boxes on resize

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">
#boxContainerContainer {<!--  w  ww  . j a v a 2s.com-->
}
#content {
   background:Chartreuse;
   text-align:center;
   display:inline-block;
   border:dotted yellow;
   margin:0px auto 11px auto;
   width:100%;
}

#box1,
#box2
 {
   max-width:26em;
   min-width:21em;
   width:46%;
   height:51px;
   background:blue;
   display:inline-block;
}
</style> 
 </head> 
 <body> 
  <div id="content"> 
   <div id="box1"></div> 
   <div id="box2"></div> 
  </div>  
 </body>
</html>

Related Tutorials