Have several fixed width layouts on one page - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Have several fixed width layouts on one page

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Lorem ipsum dolor</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body {<!--   w w w .j a  v a2s .c o  m-->
   margin:0px;
   padding:0px;
}

#content {
   background:blue;
   position:absolute;
   display:block;
   height:auto;
}

.inner {
   width:311px;
   height:201px;
   margin:6px 0px 0px 6px;
   background:orange;
   display:inline-block;
}

@media all and (min-width: 960px)  {
   #content {
      width:961px;
   }

}

@media all and (max-width: 959px)  {
   #content {
      width:641px;
   }
   
   #inner3 {
      width:631px;
   }

}
</style> 
 </head> 
 <body> 
  <div id="content"> 
   <div id="inner1" class="inner"></div> 
   <div id="inner2" class="inner"></div> 
   <div id="inner3" class="inner"></div> 
  </div>  
 </body>
</html>

Related Tutorials