Input
Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS Grid Rows Example</title> <style> html, body { height: 100%; margin: 0; } .container { display: grid; grid-template-rows: 100px auto 1fr; height: 100vh; background-color: #e8e8e8; padding: 10px; gap: 10px; } .row { padding: 20px; color: white; font-weight: bold; text-align: center; } .row1 { background-color: #ff6b6b; } /* Fixed 100px */ .row2 { background-color: #4ecdc4; } /* Auto height */ .row3 { background-color: #1a535c; } /* Flexible */ </style> </head> <body> <div class="container"> <div class="row row1">Row 1 (100px)</div> <div class="row row2"> Row 2 (auto height)<br> <p>This row grows with content.</p> </div> <div class="row row3"> Row 3 (1fr)<br> Takes remaining vertical space. </div> </div> </body> </html>