Re: Rounding of Computed Style Values

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
John Resig wrote:
> However, both Firefox 2 and 3 return precise values for computed style values, meaning that if you set a border to a em or % value it will return a value up to multiple decimal places. No other browsers do this (they all round off to the nearest whole number).

Are the values always rounded?  What if the width is set as 12.5px?  Do the 
other browsers round that?

If so, then note that you can't please everyone here:

<div style="display: inline-block">
   <div style="display: inline-block; width: 12.5px"></div>
   <div style="display: inline-block; width: 12.5px"></div>
   <div style="display: inline-block; width: 12.5px"></div>
   <div style="display: inline-block; width: 12.5px"></div>
</div>

What is the computed width of the parent?  Of each kid?  Do the numbers add up?

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.