data-type
<rounding-strategy> — CSS reference
The strategy sets the direction of rounding to a multiple of a positive interval. Nearest chooses the closest, with ties toward positive infinity; up and down are directed toward positive and negative infinity; to-zero reduces magnitude. These are function arguments, not independent property values.
Formal Syntax & Structure
css syntaxcss
nearest | up | down | to-zeroWorking Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS math lab</title><style>body {margin:0} .sample {height:12px;background:#006050}.parent {width:300px} .sample {width:40px;margin-bottom:4px} #a {margin-left: round(up, -15px, 10px)} #b {margin-left: round(to-zero, -15px, 10px)}</style><body><div class="parent"><div id="a" class="sample"></div><div id="b" class="sample"></div></div></body></html>