CSS Font Size .5 Increments

不想你离开。 提交于 2019-12-02 03:54:43

问题


In CSS are you allowed to use .5 increments i.e

font-size: 8.5pt;

Can't see the difference between font-size: 8pt and font-size: 8.5pt


回答1:


Point values are really only for print CSS.

Quoting Chris C:

A point is a unit of measurement used for real-life ink-on-paper typography. 72pts = one inch. One inch = one real-life inch like-on-a-ruler. Not an inch on a screen, which is totally arbitrary based on resolution.

Source: http://css-tricks.com/css-font-size/

The W3C Tips page suggest avoiding them for screen:

The so-called absolute units (cm, mm, in, pt and pc) mean the same in CSS as everywhere else. A length expressed in any of these will appear as exactly that size (within the precision of the hardware and software). They are not recommended for use on screen, because screen sizes vary so much. A big screen may be 60cm (24in), a small, portable screen is maybe only 8cm. And you don't look at them from the same distance.

Source: http://www.w3.org/Style/Examples/007/units.en.html




回答2:


A half point is a very small amount. Without zooming your screen, you likely will never see the difference. Nonetheless, the software IS calculating it and displaying it as best as your resolution allows.




回答3:


When you do a .5 increment while using pt. that may or may not be big enough for the browser to render larger. And then every browser renders text slightly different.



来源:https://stackoverflow.com/questions/10093688/css-font-size-5-increments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!