I'm trying to create a fluid CSS mesh, it works in Firefox and IE8 +, but NOT in Safari / Chrome / Opera, where the problem with sub-pixel rounding becomes visible:
http://jsfiddle.net/bJKQ6/2/
.column { float: left; width: 25%; }
The main container is 100% wide, and if you resize the browser in Safari / Chrome / Opera, you will see how rounded widths are contradictory.
After extensive readings about the problem, I realized that “there is no right or wrong solution” for sub-pixel rounding, but the Firefox method seems to be the best compromise for me. (For example, if I set 4 divs with a width of 25%, I expect the covered area to be 100%.)
I would like to know if I only have a CSS-only solution, or alternatively JavaScript to solve the problem.
Thanks!
UPDATE: As of May 2014, Chrome 33 and Safari 7 seem to have chosen the “Firefox” method.
javascript css rounding fluid subpixel
gyo
source share