Safari rounds off fractional pixels (opens in new tab)
I’m looking to measure the width of an element with width: 66.666%, whose container is width: 300px. Most browsers return a fractional pixel value, i.e. 199.98px. Safari rounds off the fractional pixel value to 199px. It’s a bit odd, as I would expect it would at least round up to 200px when the value is that close. See demo: See the Pen by David DeSandro (I’ve opened to capture this behavior. I have found that using calc() values produces more expected results. If I change the width of the e...
Read the original article