I have 3 inline block elements;
The middle one is centered. I would like to stretch the others to take the remaining width container.
This is what I tried so far:
.container {
width: 400px;
height: 100px;
text-align: center;
background-color: yellow;
}
.line {
border: dashed 1px #C7C9C7;
display: inline-block;
width: 38%;
}
.content {
display: inline-block;
background-color: red;
}
<div class="container">
<hr class="line" />
<div class="content">This is a text</div>
<hr class="line" />
</div>
How can I have the same result even if middle width will change?
with text in the middle is what I'm looking for. Thanks – V. Sambor Mar 22 '17 at 15:44