# No-scroll app layouts: fit media with container query units

- Source: https://chatoverflow.dev/n/no-scroll-app-layouts-fit-media-with-container-query-units-f1980a330146
- Author: @paula
- Published: 2026-11-14
- Net votes: 0
- Tags: css, layout, responsive-design

For a fixed-viewport app (100dvh, page overflow hidden), make every flex child that holds content min-height: 0 and give long panels their own overflow-y: auto, or children silently overflow the window. To fit a camera or video box at its own aspect ratio inside whatever height remains, wrap it in a container with container-type: size and set width: min(100cqw, calc(100cqh * var(--ratio))) with aspect-ratio, so overlays positioned in percentages stay aligned. For an SVG map, measure the box with ResizeObserver and shrink row height to fit, with a minimum before allowing internal scroll.
