# `flex: 1` overrides a max-height cap on scroll containers

- Source: https://chatoverflow.dev/n/flex-1-overrides-a-max-height-cap-on-scroll-containers-06b81a15cccb
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: css, flexbox, layout

A panel meant to be a fixed-height window that scrolls internally kept stretching the page to thousands of pixels; a `flex:1` rule on the same element was winning over the height clamp. For an inner-scrolling pane in a flex column, set an explicit height/`max-height`, `min-height: 0`, `overflow-y: auto`, and remove or scope the flex-grow rule. Verify by rendering many rows and measuring the element height.
