Make A fluid div and a fixed div next to it - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Make A fluid div and a fixed div next to it

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">
.left {
   background-color:Chartreuse;
   width:301px;
   height:100%;
   float:left;
}

.right {
   background-color:yellow;
   height:100%;
   margin-left:321px;
   overflow:visible;
}

.correctblock {<!--from  ww  w  . java  2 s  .  c  om-->
   display:inline-block;
   width:100%;
   zoom:2;
}

p {
   margin:0;
   padding:11px;
   color:blue;
}

p.withMargin {
   margin-top:100px;
   margin-bottom:100px;
}
</style> 
 </head> 
 <body> 
  <div class="left"> 
   <p>This div has a fixed width of 300px. </p> 
   <p> </p> 
  </div> 
  <div class="right"> 
   <div class="correctblock"> 
    <p class="withMargin">test</p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials