The height is uncertain, how to set the overflow can be scrolled

The

page is 100vh, the top half is a picture, 100vw, the height is variable, in order to maximize the display of the picture. Then the rest of the area displays the text, and I want to set the overflow-y: auto; overflow to slide to see the text. But there is no fixed height in the lower area. How to do this

Mar.20,2021

then fix it. If it's not fixed, it must be automatically stretched.


you can use the elastic box display:flex, to keep the height of the picture from being squeezed. The text below flex-shrink:0, flex-grow:1 automatically adapts to the remaining width and height and then sets overflow-y:scroll

.
Menu