Place border on inside of padding - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Place border on inside of padding

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

body{padding:0;margin:0}
#w{ width:300px;height:300px; background: grey;position:relative; }
#w:after{<!--from w w  w .  j  a va 2s .c om-->
   content:"";
   position:absolute;
   left:15px;
   top:15px;
   height:266px;
   width:266px;
   border: 2px solid black;
}


      </style> 
 </head> 
 <body> 
  <div id="w"></div>  
 </body>
</html>

Related Tutorials