There seems to be a 1px
difference in the value of element.offsetWidth
between Firefox and Chrome.
I have been researching this issue. I attempted to apply a CSS reset and moved the element further away from the screen borders (as older versions of IE were inaccurate when within 10px of the border). I came across this explanation suggesting that Firefox requires a setTimeout function, although the reason for this remains unclear...
Unfortunately, I have not found a solution yet. I am hoping to resolve or better understand it using vanilla JavaScript or CSS.
Question:
What is causing this discrepancy, and how can I adjust my CSS to achieve consistent values?
jsFiddle: http://jsfiddle.net/f35j2/show/
html
<div id="wrapper" style="width: 203px; height: 203px;">
<div id="inner" style="width: 50%; height: 50%; margin: auto; display: block;"></div>
</div>