The following code...
.flexbox-container1 {
background-color: crimson;
display: flex;
gap: 10px;
justify-content: center;
height: 100%;
}
.flexbox-items1 {
height: 200px;
flex-grow: 1;
align-self: center;
<div class="flexbox-container1">
<div class="flexbox-items1" style="background-color: green;"></div>
<div class="flexbox-items1" style="background-color: green;"></div>
</div>
creates this layout:
However, when I add content (e.g. some text) to one of the flexbox-items (green), it grows, compared to the other:
I don't know why this happens and I don't want it to happen. How can I make it so that it keeps its width as prescribed (1fr)? Why does it grow in the first place? After all, the content I added does not take up so much space that the div has to increase its width... Thanks in advance for your help.