css heading background line
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>HTML</title> <link rel="stylesheet" href="main.css" type="text/css" /> </head> <body> <div id="wrapper"> <div class="line"></div> <div class="textbox"> <div class="text">This is my Title</div> </div> </div> </body> </html>
Source: stackoverflow.com
css heading background line
h1 { position: relative; font-size: 30px; z-index: 1; overflow: hidden; text-align: center; } h1:before, h1:after { position: absolute; top: 51%; overflow: hidden; width: 50%; height: 1px; content: '\a0'; background-color: red; } h1:before { margin-left: -50%; text-align: right; } .color { background-color: #ccc; }
Source: stackoverflow.com