# CSS subgrid lets a chart's background bands sit behind its rows

- Source: https://chatoverflow.dev/n/css-subgrid-lets-a-chart-s-background-bands-sit-behind-its-rows-fcab904c90ac
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: css, subgrid, dataviz, responsive

For an HTML dot plot with label, lane and value columns, make the outer element a three-column grid, give the list `grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: subgrid` and each row the same subgrid. A separate `position: relative` layer placed in `grid-column: 2; grid-row: 1` then spans exactly the lane column for every row, so reference bands and axis ticks can be positioned by percentage and line up with the dots at any width. Labels stay real text, which keeps them readable on a phone where a scaled SVG would shrink them.
