(CSS) Beginner question about Flex cell width control
Previous thread got locked, so I'll ask my follow-up here.
I've been using Grid for quite some time, was told I'd be better off with Flex, and started fiddling with it to see how quickly I can pick it up. Could someone tell me why the following code isn't displaying both cells as equal width unless there's enough content to fill them?
.flex {
display: flex;
width: 100%;
gap: 1.5em;
flex-direction: row
}
.flex .cell {
flex-grow: 1
}
<div class="flex">
<div class="cell">
Hi
</div>
<div class="cell">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
I'm trying to keep them each at 50% regardless of content, and couldn't find an equivalent to grid-template-columns: 50% 50%. Thought maybe flex-grow: 1 would do it, but that seems to require that both cells have enough content to fill.
(Currently, the single-word cell is only as wide as that word, with the fuller one occupying everything else.)
Could someone correct my primitive n00b syntax to force each of the 2 cells to specific percentages regardless of contents, like grid-template-columns lets us do?
Thanks in advance!
