I have a CSS Grid with two areas (left
& right
). I want to put multiple span
s inside these areas, but when I do the following, the items appear on top of each other, as if they were taken out of document flow.
How do I put them back into document flow, so they appear next to each other?
div {
display: grid;
grid-template: 1fr 1fr / 1fr;
grid-template-areas: "left right"
}
div .left {
grid-area: left;
}
div .right {
grid-area: right;
}
<div>
<span class="left">First</span>
<span class="left">Second</span>
<span class="left">Third</span>
<span class="right">Fourth</span>
<span class="right">Fifth</span>
</div>