Reputation: 419
I want to put an h3 heading between 2 pairs of horizontal line
just like that :
Anyone help me with the idea to implement that in html,css
UPDATE
Please how can I do this but with an anchor tag ( actually a button ) I want it to be just like that:
Upvotes: 2
Views: 3718
Reputation: 123387
You could style a pseudoelement, like so : http://jsbin.com/epeceb/1/
CSS
h3 {
width: 500px;
font: 30px Arial;
font-weight: normal;
text-align: right;
position: relative;
}
h3 span {
background: #fff;
margin-right: 15%;
padding: 0 20px;
}
h3:before {
content: "";
width: 100%;
left: 0;
top: 50%;
margin-top: -4px;
position: absolute;
z-index: -1;
height: 0;
border-top: 8px double red;
}
Screenshot
Upvotes: 7
Reputation: 867
The best way to achieve this, is to make the two lines in css, have a div absolute that will go over the lines with a white background. Should work perfectly.
Upvotes: 3