指定字体大小的最佳方法 [英] Best way to specify font size
问题描述
大家好
使用CSS指定字体大小的最佳方法是什么?我尽量避免使用像bt和px这样的绝对单位,因为那时用户无法在IE中调整字体数量,但使用IMO时%和em是完全痛苦的。我在某个地方读过(我认为这是一个W3C小费),最好的方法是指定一个基础。大小然后
你的所有字体都是相对的,但我不确定它是如何工作的。
TIA
Hi guys
What''s the best way to specify font size using CSS? I try to avoid
absolute units like pt and px because then users can''t resize the fonts
in IE, but % and em are a complete pain to use IMO. I read somewhere (a
W3C tip I think) that the best way is to specify a "base" size and then
have all your fonts relative that, but I''m not sure how that works.
TIA
推荐答案
JD写道:
JD wrote:
大家好
使用指定字体大小的最佳方法是什么CSS?我试图避免使用像pt和px那样的绝对单位,因为那时用户不能在IE中调整字体大小,但%和em对于使用IMO来说是完全痛苦的。我在某个地方读过(我认为是W3C提示),最好的方法是指定一个基础。大小,然后
你所有的字体相关,但我不知道它是如何工作的。
Hi guys
What''s the best way to specify font size using CSS? I try to avoid
absolute units like pt and px because then users can''t resize the fonts
in IE, but % and em are a complete pain to use IMO. I read somewhere (a
W3C tip I think) that the best way is to specify a "base" size and then
have all your fonts relative that, but I''m not sure how that works.
使用%的痛苦是什么?
只需为< body>设置100% (基本大小),然后使用其他
百分比,如85%用于小字体,120%用于标题等。
这些确实相对于为< body>设置的百分比。
-
Els http://locusmeus.com/
Sonhos vem。 Sonhos v?£。 O resto ?? crisfeito。
- Renato Russo -
What''s the pain in using %?
Just set 100% for <body> (the "base" size), and then use other
percentages like 85% for small print and 120% for headings, etc.
Those are indeed relative to the percentage set for the <body>.
--
Els http://locusmeus.com/
Sonhos vem. Sonhos v?£o. O resto ?? imperfeito.
- Renato Russo -
JD写道:
JD wrote:
什么是最好的使用CSS指定字体大小的方法?我试图避免使用像pt和px这样的绝对单位,因为那时用户不能在IE中调整
字体的大小,但是%和em是使用IMO的完全痛苦。我在某处读到了(我认为是一个W3C提示),最好的方法是指定一个
base。大小,然后让你所有的字体相关,但我不确定它是如何工作的。
What''s the best way to specify font size using CSS? I try to avoid
absolute units like pt and px because then users can''t resize the
fonts in IE, but % and em are a complete pain to use IMO. I read
somewhere (a W3C tip I think) that the best way is to specify a
"base" size and then have all your fonts relative that, but I''m not
sure how that works.
body {font-size:100%; }
h1 {font-size:160%; } / *设置适当的hx * /
h2 {font-size:140%; }
h3 {font-size:125%; }
..legalese {font-size:85%; }
没有多大的痛苦。 < g取代;如果你的网站失败了这些类型的
设置,那么其他的东西就错了。
哦,以后对于CSS问题,请使用
comp.infosystems。 www.authoring.stylesheets
-
-bts
-警告:我为草坪鹿刹车
body { font-size: 100%; }
h1 {font-size: 160%; } /* set hx as appropriate */
h2 {font-size: 140%; }
h3 {font-size: 125%; }
..legalese {font-size: 85%; }
Not much of a pain. <g> If your site fails with these kinds of
settings, something else is wrong.
Oh, in future for CSS questions, use
comp.infosystems.www.authoring.stylesheets
--
-bts
-Warning: I brake for lawn deer
On Sun,11 2005年12月18:45:28 +0000,JD< us ** @ example.net>写道:
On Sun, 11 Dec 2005 18:45:28 +0000, JD <us**@example.net> wrote:
使用CSS指定字体大小的最佳方法是什么?
What''s the best way to specify font size using CSS?
我个人使用%。问题在于用户的需求变化很大,试图控制文本大小的b $ b是一种毫无意义的努力。在
结束时,用户最习惯于默认字体大小(100%),如果他们需要通过浏览器进行更改,则可以使用
。
如果可以的话,我认为网页设计中的一个陷阱就是试图获得完美的一切。优雅的降级是我们可以拍摄的最好的。
Ian
-
http://www.bookstacks.org/
这篇关于指定字体大小的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!