function
Random() — CSS reference
Draft function for selecting a numeric value within a specified interval, optionally using step increments. Results may be cached according to the function syntax; do not use it for security or deterministic tests. The local engine rejects this example; use a fixed ordinary declaration first.
Formal Syntax & Structure
css syntaxcss
width: random(40px, 80px);Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>random()</title><style>body{margin:16px;font:16px/1.5 system-ui;background:white;color:#172033} .demo{background:#dbeafe;box-sizing:border-box} button,select{font:inherit}#a{width:60px;width:random(40px,80px)}</style><body><div id="a" class="demo">Content</div></body></html>