I'm trying to have three (yellow framed) labels: A, B, and C.
I want A to be left-aligned and B and C to be right aligned. As I don't want the frame of A to grow until reaching B, I set A's display: inline
. This almost seems to work, but for some reason A is misbehaving: it shows up vertically misaligned. This seems to originate from this being the only p
element that is not a direct subchild of the flex container. But why does this happen?
body {
margin: 0px;
}
#main {
display: flex;
}
.node {
margin: 0px;
padding: 16px;
border: 2px dashed yellow;
}
<div id="main" style="background: red;">
<div style="flex-grow: 1;">
<p class="node" style="display: inline;">A</p>
</div>
<p class="node">B</p>
<p class="node">C</p>
</div>
Thanks