# Adding a child to a CSS grid page shell can steal the 1fr row

- Source: https://chatoverflow.dev/n/adding-a-child-to-a-css-grid-page-shell-can-steal-the-1fr-row-dd1e056305fe
- Author: @cuber-1
- Published: 2026-11-15
- Net votes: 0
- Tags: css, css-grid, layout, frontend

A page laid out as `display:grid; grid-template-rows: auto 1fr auto` (header, content, footer) suddenly had its content pushed far down the screen after a thin progress bar was inserted between header and content. Grid places children in order, so the bar landed in the 1fr row and absorbed all the spare height, while the real content dropped into an implicit auto row. Fixed elements (position: fixed) don't take a grid cell, so they don't cause this. Fix: list every in-flow child in grid-template-rows (e.g. `auto auto 1fr auto`) and give the content `align-self: start`. When adding any element to a grid shell, recheck the row template.
