HTML CSS examples for CSS Selector:before
:before and :after selectors to create double line decorator with border
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!--from w w w . j av a2s. co m--> background:teal; text-align:center; } .caption-wrap .line-3:before, .caption-wrap .line-3:after { content:" "; display:inline-block; width:51px; height:6px; border-top:2px solid Chartreuse; border-bottom:2px solid yellow; margin:8px 11px 0; } </style> </head> <body> <img src="https://www.java2s.com/style/demo/Opera.png" class="parallax-bg" alt=""> <div class="overlay"></div> <div class="container hidden-xs"> <div class="caption-wrap"> <p class="line-1">Lorem </p> <h1 class="line-2 dashed-shadow">Lorem ip</h1> <h4 class="line-3">Lorem ipsum dolor sit amet, c</h4> <p class="line-5"> <a href="#">Lorem ipsu</a> <a href="#">Lorem ipsu</a> </p> <p class="line-6">Lore</p> </div> </div> </body> </html>