Multiple borders around a div with a transparent layer - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div Border

Description

Multiple borders around a div with a transparent layer

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">

.box {<!--from  w  ww  .ja v a  2 s .  c  o m-->
   padding: 10px;
   background-color: #ccc;
}
.one-div {
   margin: 15px 10px;
   border: 5px solid blue;
   box-shadow: 0 0 0 5px #abc,
   0 0 0 10px red;
}
.two-div {
   margin-top: 30px;
   padding: 5px;
   border: 5px solid red;
}
.two-div > .box {
   border: 5px solid blue;
}
body {
   background-color: #abc;
}


      </style> 
 </head> 
 <body> 
  <div class="box one-div">
    (1 div, know color) 
  </div> 
  <div class="two-div"> 
   <div class="box">
     (2 divs, pure transparent) 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials