<!DOCTYPE html> <html> <head> <style> #grid{ display: grid; height:280px; grid-template-rows: repeat(auto-fill, 20px 30px 40px); background-color:lightgreen; } #item1{ grid-row: 9/10; background-color:lightblue; } </style> </head> <body> <div id="grid"> <div id="item1"> <p>This paragraph occupies 40px height of the row.</p> </div> </div> </body> </html>
Run
×
Share