concept

value-range — CSS reference

A bracketed numeric interval restricts the admissible range of a type in that grammar. Both finite endpoints are inclusive. A negative literal padding is invalid, while a math expression can be accepted and clamped at the relevant value-processing stage. Range behavior depends on the property and whether math is involved.

Formal Syntax & Structure

css syntaxcss
<length [0,∞]>

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a {padding:5px;padding:calc(2px - 8px)} #b {padding:5px;padding:-6px}</style><body><div id="parent"><div id="a">Sample</div><div id="b">Comparison</div></div></body></html>
CSS Reference