The example shows that the height of the columns is equal to the height of the largest column. How to set the height so that the height is equal to the contents of this column?
It works if the child element is set to height: max-content; but probably there is a standard method for this task?
* { paddong: 0; margin: 0; } .wrapper { width: 600px; margin-left: auto; margin-right: auto; display: grid; grid-template-rows: 1fr; grid-template-columns: repeat(3, 1fr); grid-gap: 15px; } .wrapper > div { background: orange; } <div class="wrapper"> <div> ΠΠ°ΠΆΠ΅ Π²ΡΠ΅ΠΌΠΎΠ³ΡΡΠ°Ρ ΠΏΡΠ½ΠΊΡΡΠ°ΡΠΈΡ Π½Π΅ ΠΈΠΌΠ΅Π΅Ρ Π²Π»Π°ΡΡΠΈ Π½Π°Π΄ ΡΡΠ±Π½ΡΠΌΠΈ ΡΠ΅ΠΊΡΡΠ°ΠΌΠΈ, Π²Π΅Π΄ΡΡΠΈΠΌΠΈ Π±Π΅Π·ΠΎΡΡΠΎΠ³ΡΠ°ΡΠΈΡΠ½ΡΠΉ ΠΎΠ±ΡΠ°Π· ΠΆΠΈΠ·Π½ΠΈ. </div> <div> ΠΠ°ΠΆΠ΅ Π²ΡΠ΅ΠΌΠΎΠ³ΡΡΠ°Ρ ΠΏΡΠ½ΠΊΡΡΠ°ΡΠΈΡ Π½Π΅ ΠΈΠΌΠ΅Π΅Ρ Π²Π»Π°ΡΡΠΈ Π½Π°Π΄ ΡΡΠ±Π½ΡΠΌΠΈ ΡΠ΅ΠΊΡΡΠ°ΠΌΠΈ, Π²Π΅Π΄ΡΡΠΈΠΌΠΈ Π±Π΅Π·ΠΎΡΡΠΎΠ³ΡΠ°ΡΠΈΡΠ½ΡΠΉ ΠΎΠ±ΡΠ°Π· ΠΆΠΈΠ·Π½ΠΈ. </div> <div> ΠΠ·ΠΎΠ±ΡΠ°Π²ΡΠΈΡΡ Π½Π° ΠΏΠ΅ΡΠ²ΡΡ Π²Π΅ΡΡΠΈΠ½Ρ ΠΊΡΡΡΠΈΠ²Π½ΡΡ
Π³ΠΎΡ, Π±ΡΠΎΡΠΈΠ» ΠΎΠ½ ΠΏΠΎΡΠ»Π΅Π΄Π½ΠΈΠΉ Π²Π·Π³Π»ΡΠ΄ Π½Π°Π·Π°Π΄, Π½Π° ΡΠΈΠ»ΡΡΡ ΡΠ²ΠΎΠ΅Π³ΠΎ ΡΠΎΠ΄Π½ΠΎΠ³ΠΎ Π³ΠΎΡΠΎΠ΄Π° ΠΡΠΊΠ²ΠΎΠ³ΡΠ°Π΄, Π½Π° Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ Π΄Π΅ΡΠ΅Π²Π½ΠΈ ΠΠ»ΡΠ°Π²ΠΈΡ ΠΈ Π½Π° ΠΏΠΎΠ΄Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ ΡΠ²ΠΎΠ΅Π³ΠΎ ΠΏΠ΅ΡΠ΅ΡΠ»ΠΊΠ° Π‘ΡΡΠΎΡΠΊΠ°. ΠΡΡΡΡΠ½ΡΠΉ ΡΠ΅ΡΠΎΡΠΈΡΠ΅ΡΠΊΠΈΠΉ Π²ΠΎΠΏΡΠΎΡ ΡΠΊΠ°ΡΠΈΠ»ΡΡ ΠΏΠΎ Π΅Π³ΠΎ ΡΠ΅ΠΊΠ΅ ΠΈ ΠΎΠ½ ΠΏΡΠΎΠ΄ΠΎΠ»ΠΆΠΈΠ» ΡΠ²ΠΎΠΉ ΠΏΡΡΡ. </div> </div