There are many questions (and answers) about how to create a heading with centered text and a horizontal line either side, but what I'd like to achieve is slightly different.
I'd like to add vertical lines to the left and right end of the lines:
I have got close to what I'd like using this code:
body {
padding: 50px;
}
div.outer {
width: 100%;
height: 15px;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
text-align: center;
margin: auto;
position: relative;
}
div.outer>span {
font-size: 16px;
background-color: #FFF;
padding: 0 10px;
position: absolute;
top: -10px;
left: 47%;
}
<div class="outer">
<span>A Heading</span>
</div>
Can anyone please point me in the right direction?
UPDATE
Thank you @nvioli for pointing me in the right direction. I ended up using a combination of your answer and flex based on this post
Here’s what worked for me: pen