Add Children div with border - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div Border

Description

Add Children div with border

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 {<!-- ww  w  .  jav  a2  s.c o m-->
   width:100px;
   height:200px;
   border:solid 1px #000;
}
#container div {
   float:left;
}
#a, #b {
   width:50px;
   height:50px;
}
#a {
   background:red;
}
#b {
   background:yellow;
}
#c, #d {
   width:50px;
   Box-sizing: Border-box;
   height:50px;
   border:solid 1px #000;
}
#c {
   background:blue;
}
#d {
   background:green;
}


      </style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="a"></div> 
   <div id="b"></div> 
  </div> 
  <div id="container"> 
   <div id="c"></div> 
   <div id="d"></div> 
  </div>  
 </body>
</html>

Related Tutorials