浮点长度值对像素单位有意义吗? [英] Does floating point length value make sense on pixel unit?
问题描述
当我尝试为:
px'
:pixels; 1px
等于
$中的1 / 96th b
$ b
13.1px
将与 0.1364in
相同,其中 13px
会 0.1354in
。
这就是说,你应该使用我的意见中的相对值,而 pt
表示整体底座尺寸。
When I try write stylish CSS for forums.asterisk.org site, I saw they use floating point length value on pixel unit, for example: font-size: 13.1px;
.
As far as I known, pixel is the smallest unit in screen, so does floating point length value make sense on pixel unit?
Screenshot
It's fine, the CSS recommendation allows numbers (not only integers) as values for pixels. Note that px
is actually defined in terms of in
in the recommendation:
‘px’
: pixels; 1px
is equal to 1/96th of 1in
All in all 13.1px
will be the same as 0.1364in
, where 13px
would be 0.1354in
. The difference is small, but noticeable.
That being said, you should use relative values in my opinion instead, and pt
for the overall base size.
这篇关于浮点长度值对像素单位有意义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!