I'm trying to create a kind of sub-grid which looks like this:
The first element should be full width and the rest have to be in the same line (same width each one) no matter how many items are present.
My attempt:
HTML
<div class="flex-container">
<div class="flex-item">I'm the biggest!</div>
<div class="flex-item"></div>
<div class="flex-item"></div>
<div class="flex-item"></div>
<div class="flex-item"></div>
<div class="flex-item"></div>
<div class="flex-item"></div>
</div>
CSS
.flex-container {
display: flex;
flex-wrap: wrap;
}
.flex-container .flex-item {
flex: 1;
}
.flex-container .flex-item:first-child {
width: 100%;
}
I'm a newbie in flex, so, in my newbie abstraction, in theory this should work, but it doesn't. It makes all the .flex-item
being in the same line with the same width (which I want to happen but only with the :not(:first-child)
flex dudes).