Make 3 divs with internal margin - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Make 3 divs with internal margin

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">
#outer {<!--   w w w. j  a v  a2s  .co  m-->
   width:801px;
   height:801px;
   position:absolute;
   background:yellow;
}

#middle {
   width:751px;
   height:751px;
   position:relative;
   margin:16px 26px 0px 26px;
   background:red;
}

#inner {
   width:701px;
   height:701px;
   top:21px;
   left:26px;
   position:absolute;
   background:green;
}
</style> 
 </head> 
 <body> 
  <div id="outer"> 
   <div id="middle"> 
    <div id="inner"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials