function
round() — CSS reference
Round to a multiple of an interval. Nearest is the default and exact ties go toward positive infinity. Up and down choose toward positive and negative infinity, respectively; to-zero moves toward zero. A zero step produces NaN. For portability provide an explicit positive step; current grammar permits omission for number arguments.
Formal Syntax & Structure
css syntaxcss
round([ <rounding-strategy> , ]? <calc-sum> [ , <calc-sum> ]?)Working 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 {width: round(125px, 50px)} #b {width: round(down, 139px, 50px)}</style><body><div class="parent"><div id="a" class="sample"></div><div id="b" class="sample"></div></div></body></html>