I donβt remember where I found this technique, but this page contains several similar solutions:
<html> <head> <title>hm</title> <style type="text/css" media="screen"> body{ background:#000; } .heading{ color:#1d4b76; padding-top:1em; width:10em; text-align:center; } .heading h2 { font-size:2em; padding:.2em; margin:0; background-color:#1e1e1e; } b.rtop b, b.rbottom b{display:block;height: 1px; overflow: hidden; background: #1e1e1e} b.r1{margin: 0 5 0 5px} b.r2{margin: 0 2 0 3px} b.r3{margin: 0 1 0 2px} b.rtop b.r4, b.rbottom b.r4{margin: 0 0 0 1px; height: 2px; background:#1e1e1e;} </style> </head> <body> <div class="heading"> <b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b> <h2>Example!</h2> <b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b> </div> </body> </html>
For the site I used this on, I removed the right margins to use them for the right-aligned headers ( b.r1{margin: 0 0 0 5px} , etc.):
Rounded corner example http://img81.imageshack.us/img81/1796/picture4o.png
source share