处理多种浏览器字体大小 [英] handling multi browser font sizes

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

问题描述

我已经在样式表上运行了CSSCheck并且我总是收到警告

与此类似:


" font:bold 9pt / 100%sans-serif


警告:通常不应在网上使用绝对长度单位......


但如果我使用''x-small''而不是9pt,我在IE6上获得更大的类型,在

Mozilla上使用更小的

类型。我的选择似乎是:


1.保持绝对的9pt设置,以便在浏览器之间保持更加一致的显示(并打破精神)样式表)


2.使用''x-small''并使用不同的显示结果(但是

兼容

用户定义的样式表和其他输出媒体)。


是吗?


I''ve run CSSCheck on my style sheets and I always get a warning
similar to this:

"font: bold 9pt/100% sans-serif

Warning: Absolute length units should not generally be used on the Web ..."

Yet if I use ''x-small'' instead of 9pt, I get bigger type on IE6 and smaller
type on
Mozilla. My choices seem to be:

1. keep the absolute 9pt setting in order to maintain a much more consistent
display between browsers (and break the spirit of the stylesheets)

2. use ''x-small'' and live with the different display results (yet be
compatible with
user defined stylesheets, and other output media).

Is that it?


推荐答案

" J" <所以********* @ nobody.com>在消息中写道

新闻:40 *********************** @ news.twtelecom.net。 ..

...

| 2.使用''x-small''并使用不同的显示结果

(还是

|兼容

|用户定义样式表和其他输出媒体)。


不是你,而是你的用户有b / b $ b来忍受它。他们会将字体

设置为他们自己选择的大小,如果你没有通过指定

字体(以像素为单位)来填充它们。 />

为了便于使用,你应该

永远不要指定像素字体..


-

Andrew Thompson

* http://www.PhySci .org / PhySci软件套件

* http:// www.1point1C.org/ 1.1C - Superluminal!

* http://www.AThompson.info/andrew/ 个人网站
"J" <so*********@nobody.com> wrote in message
news:40***********************@news.twtelecom.net. ..
...
| 2. use ''x-small'' and live with the different display results
(yet be
| compatible with
| user defined stylesheets, and other output media).

It is not you, but your users who have
to put up with it. They will set fonts
to a size of their own choosing if you
do not stuff them up by specifying
fonts in pixels.

For the sake of useability, you should
never specify fonts in pixels..

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site




" J" <所以********* @ nobody.com>在消息中写道

新闻:40 *********************** @ news.twtelecom.net。 ..

"J" <so*********@nobody.com> wrote in message
news:40***********************@news.twtelecom.net. ..
我在样式表上运行了CSSCheck并且我总是收到类似的警告

" font:bold 9pt / 100 %sans-serif

警告:绝对长度单位通常不应在网上使用
....
然而,如果我使用''x-small''而不是9pt,我在IE6上获得更大的类型,而在Mozilla上获得
更小的类型。我的选择似乎是:

1.保持绝对的9pt设置,以便在浏览器之间保持更多的
一致显示(并打破样式表的精神)


从理论上讲,确保

浏览器之间的绝对一致性不是你的工作。这取决于浏览器决定用于显示文本的基本大小

。如果用户不喜欢他的浏览器的默认设置,那么他可以使用浏览器的机制来增加或减少文本大小。如果他/ b $ b更喜欢页面在不同浏览器中的显示方式,那么他将使用

不同的浏览器。生命太短暂,除非对客户的一致性需求来自你的客户,而且你按小时收到工资。


话虽如此,我认为从

a范围内指定字体大小是合理的。较大的文字更开放,更友好;较小的文字更正式,更严肃,并且更好地利用了可用空间。此外,如果我设置


body {font-size:100%;无衬线字体;那么
然后在所有的图形浏览器中,文本看起来都非常大。

所以如果我的一般正文是sans-serif,那么我''我倾向于使用

字体大小为80%-90%。对于衬线,90%-100%。嗯,使用小字母。而不是

百分比,我似乎用serif和

sans-serif得到了不错的结果 - 我发现x-small在所有浏览器中都太小了。 />
2.使用''x-small''并使用不同的显示结果(但与
用户定义的样式表和其他输出媒体兼容)。
I''ve run CSSCheck on my style sheets and I always get a warning
similar to this:

"font: bold 9pt/100% sans-serif

Warning: Absolute length units should not generally be used on the Web ...."
Yet if I use ''x-small'' instead of 9pt, I get bigger type on IE6 and smaller type on
Mozilla. My choices seem to be:

1. keep the absolute 9pt setting in order to maintain a much more consistent display between browsers (and break the spirit of the stylesheets)
Theoretically, it''s not your job to assure absolute consistency among the
browsers. It''s up to the browsers to decide what base size to use for text
they display. If a user doesn''t like his browser''s default, then he can use
the browser''s mechanism for increasing or decreasing the text size. If he
prefers the way pages look in a different browser, then he''ll use a
different browser. Life is just too short, unless the demand for consistency
comes from your customer and you''re getting paid by the hour.

Having said that, I think it''s reasonable to specify a font size from within
a range. Larger text is more open, more friendly; smaller text is more
formal, more serious, and makes better use of the available space. Moreover,
if I set

body { font-size: 100%; sans-serif; }

then the text seems ridiculously large to me in ALL the graphical browsers.
So if my general body text is to be sans-serif, then I''m inclined to use
font-size of 80%-90%. For serif, 90%-100%. Hmm, using "small" instead of
percentages, I seem to get decent results with both serif and
sans-serif--and I find x-small much too small in all browsers.

2. use ''x-small'' and live with the different display results (yet be
compatible with
user defined stylesheets, and other output media).



在文章< Tq ****************** @ news-server.bigpond.net.au>中, andrew64

@ bigNOSPAMpond.com启发我们...
In article <Tq******************@news-server.bigpond.net.au>, andrew64
@bigNOSPAMpond.com enlightened us with...
" J" <所以********* @ nobody.com>在消息中写道
新闻:40 *********************** @ news.twtelecom.net。 ..
..
| 2.使用''x-small''并使用不同的显示结果
(但是
|与用户定义的样式表和其他输出媒体兼容)。

不是你,而是你的用户有能力忍受它。他们会将字体设置为他们自己选择的大小,如果你没有通过指定
字体来填充它们。

为了便于使用,你应该从不指定像素字体..
"J" <so*********@nobody.com> wrote in message
news:40***********************@news.twtelecom.net. ..
..
| 2. use ''x-small'' and live with the different display results
(yet be
| compatible with
| user defined stylesheets, and other output media).

It is not you, but your users who have
to put up with it. They will set fonts
to a size of their own choosing if you
do not stuff them up by specifying
fonts in pixels.

For the sake of useability, you should
never specify fonts in pixels..




你知道,没有人告诉我(我也没有在初学者的网站上看到它)当我开始使用网页设计(个人

网站)时,

我当时正在使用。

我发现很久以后当我以像素为单位指定字体时,

试图在浏览器中调整大小没有做任何事情。

我立即将所有尺寸改为小型,中型等等。 />

所以,加上我的意见 - 不要使用像素。这对于正常的用户而言是非常卑鄙的,对视障人士来说非常糟糕。


担心浏览器如何呈现这些尺寸并不是你的工作 -

因为如果你用相对的术语指定它们,如百分比或小,

中等,用户可以轻松改变大小,如果他们也发现它

小。如果你使用像素,他们就不能这样做。


-

-

~kaeli~

一个男人的家是他的城堡......,在一个讲话的庄园里。
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



You know, no one told me that (nor did I see it in the beginner''s sites
I was using at the time) when I started out with web design (personal
sites).
I found out quite some time later that when I specified font in pixels,
trying to up the size in the browser did nothing.
I immediately changed all my sizes to small, medium, etc.

So, add my opinion to this one - don''t use pixels. It''s mean to normal
users and downright awful to visually impaired people.

It is not your job to worry about how the browser renders those sizes -
because if you specify them in relative terms like percents or small,
medium, etc, the user can easily change the size if they find it too
small. They can''t do that if you use pixels.

--
--
~kaeli~
A man''s home is his castle..., in a manor of speaking.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


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

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