I have a header and I want to put a dashed horizontal line to the left and right side of this header as you can see in the jsfiddle
https://jsfiddle.net/uLake5g3/9/
This is my HTML:
<div class = "spotlight">
<div class = "container spotlight__main">
<h2><span class ="background__red">In the spotlight</span></h2>
</div>
</div>
And this is my CSS:
h2 > span {
position: relative;
display: inline-block;
}
h2 > span:before,
h2 > span:after {
content: "";
position: absolute;
top: 50%;
border-bottom: 1px dashed;
width: 96rem;
margin: 0 auto;
vertical-align: center;
}
h2 > span:before {
right: 100%;
}
h2 > span:after {
left: 100%;
}
I want to have the dashed lines inside the spotlight_main his border, but they are going outside.