Why won't flex 1 fill available space?
.container {
display: flex;
align-items: flex-start;
justify-content: space-between;
background: #FFFFFF;
box-shadow: 0px 8px 20px rgb(0 0 0 / 8%);
border-radius: 45px;
padding: 30px;
margin-bottom: 40px;
}
.sub-container-one {
font-size: 100px;
}
.sub-sub-container-two {
display: flex;
align-items: center;
/* this apparently should work but it doesn't */
flex: 1;
}
<div class="container">
<div class="sub-container-one">
ftftftftftftf
</div>
<div class="sub-container-two">
<div class="sub-sub-container-two">
ghghghghghghghghghghghg
</div>
</div>
</div>
Fill remaining vertical space with CSS using display:flex
flex: 1; /* 1 and it will fill whole space left if no flex value are set to other children*/
There are no other children in the div.
Why can't I center sub-sub-container-two
?
I found this question: Flexbox: center horizontally and vertically
It suggests to use a fix height but I can't do this because it needs to support multiple entries. How can I make flex 1 fill available space?