How to set maximum height of N parental heights using CSS?

I already asked a question and solved it myself using jQuery, but I want to solve it with CSS. I use simple CSS.

Here is the answer .
@ Mamun invited me to ask a new question, so I asked him again.
See Question for details.

Update from previous question

I have dynamically added divs ( .class-row-notification) to another div ( ). Now I want to set the first 5 the divs height to your parent (including , , , etc.) ..). .class-append-con
max-heightmarginpaddingbottom-border

Adding the first five classes div ( .class-row-notification) ( children div ) == class ( ) ( parent div ) max-height .class-append-con

How to do it? If through CSS it should be a cross browser.

Updated jsFiddle

Thank.

+1
source share
1 answer

I tried something here, and I think this is what you mean

.class-append-con :nth-child(-n+5) {
    height: 100%;
} 

Here is an example you like

0
source

Source: https://habr.com/ru/post/1690377/


All Articles