Make a border 2px in from the containing box - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Make a border 2px in from the containing box

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 w w .  j av  a 2  s.  c  o m-->
   width: 200px;
   height: 100px;
   background-color: orange;
   position: relative;
   padding: 32px;
   border-radius: 16px;
}
.box:after {
   content: "";
   position: absolute;
   left: 16px;
   right: 16px;
   top: 16px;
   bottom: 16px;
   border: 4px solid #fff;
   border-radius: 16px;
}


      </style> 
 </head> 
 <body> 
  <div class="box">
    Some Content 
  </div>  
 </body>
</html>

Related Tutorials