HTML CSS examples for CSS Property:border-bottom
Create Bottom border wider than div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> *, *:before, *:after {<!-- ww w .ja va 2s .co m--> margin:0; padding:0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .demo { background:dodgerblue; width:50%; height:100px; margin:0 auto; } .demo:last-child { position:relative; } .demo:last-child::after { content:""; display:block; box-sizing:border-box; position:absolute; left:-50%; bottom:0; width:100vw; border-top:1px solid black; } </style> </head> <body> <div class="demo"></div> <hr> <div class="demo"></div> </body> </html>