字体大小 - 转换为实际磅值
向大家快速提问:
有谁知道将字体大小设置为以下值时实际的磅值是多少:
- 大、
- 较大、
- 中
- 、
- 小、
- X-Large
- X-Small
- XX-Large
- XX-Small
Quick question for everyone:
Does anybody know what the actual point size would be when setting the font-size to the following values:
- Large
- Larger
- Medium
- Small
- Smaller
- X-Large
- X-Small
- XX-Large
- XX-Small
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
此图表解释了字体大小与像素的关系:
Font sizes to pixels are explained by this chart:
它可能会因浏览器而略有不同,但在大多数情况下应该有效:
大为 18 px,约为 13.5 pt
较大为 19 px,约为 14 pt
中为 16 px,约为 12 pt
小为 13 px,约为 10 pt
Smaller 为 13 px,约为 10 pt
X-large 为 24 px,约为 18 pt
X-small 为10 px,大约 7.5 pt
XX-large 是 32 px,大约 24 pt
XX-small 是 9 px,大约 7 pt
这是基于查看计算的字体大小样式(以像素为单位)并从 此图表。 此链接也可能有帮助。
It may vary by browser slightly but for the most part this should work:
Large is 18 px which is around 13.5 pt
Larger is 19 px which is around 14 pt
Medium is 16 px which is around 12 pt
Small is 13 px which is around 10 pt
Smaller is 13 px which is around 10 pt
X-large is 24 px which is around 18 pt
X-small is 10 px which is around 7.5 pt
XX-large is 32 px which is around 24 pt
XX-small is 9 px which is around 7 pt
This is based off of seeing the computed font-size style in pixels and converting from this chart. This link might also be helpful.
medium
是用户首选的字体大小。所有其他值均由浏览器定义。 (来源)medium
is the user's preferred font size. All other values are defined by the browser. (source)如果您能够使用java脚本,那么您可以使用canvas元素测量给定字体大小的高度。大小将返回您指定的字体高度的像素值。仅当用户校准了屏幕时,这才有效:大多数都没有,但对于大多数显示器设置来说,默认值通常很接近。
If you are able to use java script then you can, using a canvas element, measure the height of a given font size. The size will return a value in pixels for the height of the font you specify. This will only work if the user has calibrated their screen: most have not but the default values are generally close for most monitor setups.
两个好的网络链接可能会回答这个问题:
Two good weblinks might answer this: