My goal is to horizontally align three elements, where the middle element is an <hr>
that takes up all available space(width: 100%
) pushing the outer two elements to the sides.
The result would be like this: AAA-------BBB
, where the <hr>
element is represented with the hyphens.
What I've tried
I've experimented with display: inline-block
but with no luck.
div {
display: inline-block;
background: #777;
}
hr {
width: 100%;
}
<div>
<h1>AAA</h1>
<hr />
<article>
<p>BBB</p>
</article>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…