HTML CSS examples for CSS Widget:Border Style
Place border on inside of padding
<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>