html/css 中元素可以有小数高度吗?
我正在一个网站上工作,当我用 firefox 中的 firebug 查看它时,各种元素的高度似乎都是 133.8 像素,而 chrome 中的 firebug lite 报告的高度为 133px,使用相同的方法。 这是浏览器渲染的差异,还是只是 firebug 带来的好奇心? 我认为像素必须以整数来测量......
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有趣的事情。我今天刚刚尝试过,Chrome 25 和 Firefox 19 似乎支持它,我什至使用了内联 img 宽度和高度:
我有一系列具有绝对定位的图块连接形成对角线,我知道它有效,因为该线是波浪形的,我必须使用 .5 才能使其变直。
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:
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.
您可以使用
px
以外的单位来表示小数值。像em、in、
等。You can have decimal values in units other than
px
. Likeem, in,
etc.