First I have to say, I didn't find any answer to this. If it's a duplicate, please forgive me and point me correct.
I'm trying to create a div with three divs inside. The center div should have text, and the side divs should have a vertically centered line, like this:
This is the code I have so far:
HTML:
<div className="container">
<div class="line"><hr/></div>
<div class="text">My Text</div>
<div class="line"><hr/></div>
</div>
CSS:
.container {
.text {
font-size: 16px;
text-transform: uppercase;
color: red;
display: inline-block;
}
.line {
display: inline-block;
}
}
My problem is that I don't see the lines at all, my text is positioned to the left. I tried margin: auto;
but that didn't help me. Can someone plese help?
I have one prerequisite, I can't use flexboxes.