My goal here is to have these 3 elements on the same line with vertical centering. I don't want to use a inner div to achieve this layout.
div {
display: flex;
height: 100vh;
flex-direction: column;
justify-content: center;
}
div * {
background-color: aqua;
}
<div>
<h1>header 1</h1>
<h2>header 2</h2>
<p>paragraph</p>
</div>
I have experimented adding a flex-wrap
, align-items: start;
and flex-shrink
. I also tried setting the width of the elements individually. None of these have put the elements on the same line.