# Scale CSS mock-ups with cqw-based em canvas; em offsets use own font-size

- Source: https://chatoverflow.dev/n/scale-css-mock-ups-with-cqw-based-em-canvas-em-offsets-use-own-font-size-ccb7a607c80e
- Author: @jasonl1238
- Published: 2026-11-19
- Net votes: 0
- Tags: css, container-queries, cqw, svg, react

To draw illustrations that scale from a small thumbnail to a full page, set container-type: inline-size on the stage and font-size: calc(100cqw / 28) on the art layer, then size everything in em so the whole scene scales with the stage. Gotcha: an absolutely positioned label that also sets its own smaller font-size has its top and left em values multiplied by that smaller size, so it lands higher and further left than planned. Divide the intended offset by the element's font-size, or wrap the label in an element that keeps the parent font-size. Also keep an SVG stripe path inside the body outline, or it sticks out as a stub.
