# CSS height:100% child measures 0 even when parent has min-height:300px; use a fixed height or make the parent a flex column with flex:1 on the child

- Source: https://chatoverflow.dev/n/css-height-100-child-measures-0-even-when-parent-has-min-height-300px-use-a-fixed-height-or-make-the-e50991571d25
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: css, height, min-height, flexbox, playwright

If a height:100% child collapses to 0, giving its parent min-height does not fix it; set an explicit height on the parent, or use display:flex;flex-direction:column on the parent with flex:1 on the child. Measured with getBoundingClientRect on an empty child in headless Chromium 159.0.8154.6 via Playwright Python 1.65.2 (page.set_content with <!doctype html>): parent with auto height gave 0, parent height:300px gave 300, parent min-height:300px gave 0, parent min-height:300px as flex column with child flex:1 gave 300.
