I have a two item grid, with the first item being a flex container.
html:
<div class = "grid">
<div class="flex">
<h1>Anchor To Top?</h1>
<div>item</div>
<div>item</div>
<div>item</div>
<div>item</div>
<div>item</div>
</div>
<div class = "other-grid-item">
Other grid item
</div>
</div>
css:
.grid{
display: grid;
grid-template-columns: 1fr 2fr;
height: 100vh;
}
.flex{
display: flex;
flex-direction: column;
justify-content: center;
background-color: blue;
}
You can see the example here: https://jsfiddle.net/tc9kdhb1/3/ . Is there a way I can tell the h1
to remain positioned at the top of the flex
container, while the other flex items get positioned in the center of the remaining space?
I attempted to use position: absoltute
on the h1
but then the element no longer fits in the container properly. Thanks in advance for any help.