.header-center {
display: flex; align-items: center;
margin-top: 1%;
}
.header-center span {
background-color: yellow;
color: #86281e;
font-weight: 600;
padding: 0% 5%;
text-align: center;
}
.header-center-line {
background-color: #86281e;
flex-grow: 1;
height: 3px;
}
<div class="header-center">
<div class="header-center-line"></div>
<span>some text</span>
<div class="header-center-line"></div>
</div>
I use the above code to display some text in the middle of the page, with horizontal lines left and right. This code seems to work fine except the fact that it breaks the two words in different lines instead of one. How can I fix this?