Answer the question
In order to leave comments, you need to log in
How to stretch an empty block to the height of an adjacent filled with content?
Actually - here is a sandbox with an example
. There are two blocks, one is empty, it has a picture / color on the background, the second is next to the content, how to make the empty block stretch by the size of the block with the content? Wrapped block in a container with display: flex
Answer the question
In order to leave comments, you need to log in
remove the empty block height: 100%;
and instead of width 30% it's better to use flex: 0 0 30% or whatever
.wrap {
/* Не обязательно задавать, так как значение по умолчанию */
align-items: stretch;
}
/* Убрать height: 100% */
.left {
flex-shrink: 1;
width: 30%;
background-color: green;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question