A
A
aftar2022-01-28 13:02:16
css
aftar, 2022-01-28 13:02:16

Is it possible to automatically calculate max-height on css?

Good afternoon! Let's say there is such a form, you need the text to occupy the entire remaining height, and if it doesn't fit, a scroll appears.
I know that for this you need to register your own max-height.
But the problem is that the title is... dynamic, and in one case it can take 50px, in another 100px. Therefore, it cannot be calculated.

Of course, you can stretch it with the help of the flex-grow property, but you need max-height.
Maybe someone has come across this and knows a feature how to do it.61f3bf1cae689797680870.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg, 2022-01-28
@Olegeks

try not with pixels, but as a percentage - example - max-height: 10%;

A
Aleksandr Zakordonnyi, 2022-01-28
@AlexRoode

Add a class to the block with the test overflow-y: auto;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question