cqb
One percent of the container's block size, the direction lines stack along.
Safe to useBaseline: widely available
| Browser | Since |
|---|---|
| Chrome | 105+ |
| Chrome Android | 105+ |
| Edge | 105+ |
| Firefox | 110+ |
| Firefox Android | 110+ |
| Safari | 16+ |
| Safari iOS | 16+ |
Formula 1cqb = 1/100 of the nearest container's block size
How it works
1cqb is 1% of the container’s block size: the height in horizontal text and the width in vertical text. Like cqh, it needs a container whose block size does not depend on its children, which means container-type: size.
In a container that only has inline-size containment, cqb looks for another ancestor that does measure the block axis, and uses the small viewport block size when there is none. With no such ancestor, ten cqb inside it equals ten svb, and since a card normally has no say in how tall the window is, the number is usually not what the author intended. With an outer container-type: size box 300px tall around it, ten cqb was 30px, taken from the outer box while cqi on the same element came from the inner one.
As with cqi, the axis is the one of the element using the unit. In Chromium, an element set in vertical-rl inside a horizontal container read its cqb along the container’s width, because for that element the block direction runs sideways. Choose cqb over cqh for the same reason you choose cqi over cqw: it follows the writing mode, where cqh always means the physical height.
Try it
A container you can resize
Drag the sliders. The box is a real query container, and the readings are 10 of each container unit measured inside it.
- Container, measured
- 300 × 140px
10cqw- 30px
10cqh- 14px
10cqi- 30px
10cqb- 14px
10cqmin- 14px
10cqmax- 30px
The same as a table
| Unit | 300 × 140px | 500 × 140px |
|---|---|---|
10cqw | 30px | 50px |
10cqh | 14px | 14px |
10cqi | 30px | 50px |
10cqb | 14px | 14px |
10cqmin | 14px | 14px |
10cqmax | 30px | 50px |
What changes it
- Moves with
- page zoom
- the query container
- the writing mode
- Stays put under
- the reader's text size
- the window size
- the font in use
- phone toolbars
Reach for it when
Heights inside fixed-height containers, in any writing mode.
Watch out
Inside an inline-size container nested in a size container 300px tall, 10cqb was 30px from the outer box while 10cqi came from the inner one. The two axes look up the tree separately.
.pane .thumb {
block-size: 40cqb;
}