关于字体大小 [英] About font sizes

查看:56
本文介绍了关于字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,大多数浏览器制造商已经同意16px的

默认字体大小。


因此,这应该是一个准确的转换百分比:


px%


16 = 100

14 = 87.5

13 = 81.25

12 = 75

10 = 62.5

我认为最好坚持一个百分比将产生一个数字 -

而不是使用90%这样的东西获得14.4。浏览器只会向上计算
或者它可以显示的字体大小,对吗?


至于em,我说的是1em = 16px ?


这意味着1.2em是19.2px(浏览器四舍五入到19px - 如果默认

大小是16)?

As I understand it, most browser manufacturers have agreed on 16px for their
default font size.

So, this should be an accurate conversion for percentages:

px %

16 = 100
14 = 87.5
13 = 81.25
12 = 75
10 = 62.5

I assume it''s better to stick to a percentage that will yield a round number -
rather than using something like 90% to get 14.4. A browser will just round up
or down to a font size it can display, correct?

As for em, am I correct in saying 1em = 16px?

Does that mean 1.2em is 19.2px (rounded by the browser to 19px - if the default
size is 16)?

推荐答案

deko写道:
deko wrote:
据我了解,大多数浏览器制造商都同意16px用于
他们的默认字体大小。


我认为对于大多数

用户来说,16px很容易阅读,因此微软将其设置为默认值,其他浏览器供应商

跟随套件。


虽然它可以被用户覆盖。

所以,这应该是百分比的准确转换:


不,因为你不知道用户没有表达自己的

偏好。

至于em,我说的是1em = 16px吗?
As I understand it, most browser manufacturers have agreed on 16px for
their default font size.
I think it is more of a case that 16px is easy to read for a majority of
users, so Microsoft set it as their default, and other browser vendors
followed suite.

Its overridable by the user though.
So, this should be an accurate conversion for percentages:
No, since you don''t know that the user hasn''t expressed their own
preference.
As for em, am I correct in saying 1em = 16px?




不,见上文。


-

David Dorward< http://blog.dorward.me.uk/> < http://dorward.me.uk/>

Home是〜/ .bashrc的地方



No, see above.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


>不,因为您不知道用户没有表达自己的
> No, since you don''t know that the user hasn''t expressed their own
首选项。




假设16是默认值,这就是用户目前正在使用的内容,并且它没有被覆盖
....


然后我的数学是正确的。


一个基本指南(基于16)可能看起来像这样(假设上面的陈述!)


137.5%= 22px(h1)
125%= 20px(h2)

112.5%= 18px(h3)

100%= 16px(大)

87.5%= 14px(中)

81.25%= 13px(小)

75%= 12px(较小)

62.5%= 10px( legalese)


重点是,如果你打算使用百分比,你可以调整到客户端浏览器可以显示的字体大小。如果16是默认值,那么最好用它作为调整的基础。



assuming 16 is the default, and this is what the user is currently using, and it
has not been overridden....

then my math is correct.

A basic guide (based on 16) might look like this (assuming the above statement!)

137.5% = 22px (h1)
125% = 20px (h2)
112.5% = 18px (h3)
100% = 16px (large)
87.5% = 14px (medium)
81.25% = 13px (small)
75% = 12px (smaller)
62.5% = 10px (legalese)

The point is, if you are going to use percentages, you might as well adjust to a
font size that the client browser can display. If 16 is the default, then it''s
best to use that as a basis for adjustment.


deko写道:
deko wrote:
不,因为你不知道用户没有表达自己的
偏好。
假设16是默认值,这是用户当前正在使用的,
并且它没有被覆盖....
No, since you don''t know that the user hasn''t expressed their own
preference.
assuming 16 is the default, and this is what the user is currently using,
and it has not been overridden....




这是很多假设。

重点是,如果你打算使用百分比,你可以调整到客户端浏览器可以显示的字体大小。



That is a lot of assumptions.
The point is, if you are going to use percentages, you might as well
adjust to a font size that the client browser can display.



系统可以将字体大小调整到可以接受的范围,因此担心它的任何一点都不会真的花费b / b $

-

David Dorward< http://blog.dorward.me.uk/> < http://dorward.me.uk/>

首页是〜/ .bashrc的位置



Systems can round font sizes to something acceptable, so there''s not really
any point in worrying about it.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


这篇关于关于字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆