问题
I am working on a site, when I look at it with firebug in firefox various elements seem to have heights like 133.8 pixels, whereas firebug lite in chrome reports the height as 133px for the same method. Is this a difference in the browser rendering, or is it just a curiousity brought on by firebug? I thought pixels had to be measured in integers...
回答1:
You can have decimal values in units other than px
. Like em, in,
etc.
回答2:
Funny thing. I just tried today and booth Chrome 25 and Firefox 19 seemed to support it, and I even used inline img width and height:
<img src="something" width="39" height="21.5" />
I had a series of tiles with absolute positioning connected to form a diagonal line, and I know it worked because the line was wavy and I had to use the .5 to make it straight.
来源:https://stackoverflow.com/questions/4778109/can-an-element-have-a-a-decimal-height-in-html-css