unit

rch — CSS reference

rch resolves as ch does on the root element, rather than using the descendant’s own metrics. A measure of 60ch is not a guarantee of 60 characters in proportional text. Glyph orientation and font selection matter; fallback is generally half an em, or one em for upright vertical text. Root font or line-height changes can affect uses of this unit; do not assume a constant pixel value.

Formal Syntax & Structure

css syntaxcss
width: 4rch;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>Relative length lab</title><style>body {margin:0} .sample {height:12px;background:#006050}html {font:20px/28px monospace} #a {font:20px/28px monospace;width:4rch} #b {font:40px/56px monospace;width:4rch}</style><body><div id="a" class="sample"></div><div id="b" class="sample"></div></body></html>
CSS Reference