HTML CSS examples for CSS Widget:Border
Using :before and :after to add border to a div
<html lang="en"> <head> <style> .innerCnt {<!--from ww w .j ava 2 s . c o m--> background:Chartreuse; position:relative; z-index:2; border-radius:6px; } .innerCnt ul { margin:0 } .borderBox { height:100px; border:2px solid yellow; border-radius:9px; position:relative; } .borderBox:after, .borderBox:before { border:2px solid blue; content:" "; position:absolute; height:100%; width:100%; top:2px; border-radius:9px; } .borderBox:after { top:4px; border-radius:8px; } </style> </head> <body translate="no"> <div class="borderBox"> <div class="innerCnt"> <ul> <li>Lorem Ipsum</li> <li>Lorem Ipsum</li> <li>Lorem Ipsum</li> <li>Lorem Ipsum</li> </ul> </div> </div> </body> </html>