字体大小 - 最佳实践... px与em [英] Font sizes - Best practice... px vs. em

查看:94
本文介绍了字体大小 - 最佳实践... px与em的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题...哪个更适合用于定义字体大小以及为什么?

px和em似乎是主要的候选者。我知道一般的答案

会是什么,但我希望最终得到一些好的现实世界

的例子。


消防! :)


问候,

Peter Foti

解决方案

Peter Foti写道:

简单问题...最好用于定义字体大小


em

为什么?


由于ciwas *之前讨论的原因*之前很多次。如果你还没有读过它们,谷歌将会支付你的资金。

我知道一般的答案是什么,


然后为什么提出问题?好像浪费你的时间。

但我希望最终得到一些好的真实世界的例子。




网站示例使用em为font-size?好的,这里有两个:

http://www.julietremblay .com /
http://people.umass.edu/ btrembla /


-

Brian

按照我地址中的说明给我发电子邮件


Peter Foti写道:

简单问题...哪个更好用于定义字体大小及其原因?
px和他们似乎是主要候选人。我知道一般的答案是什么,但我希望最终得到一些好的现实世界
的例子。

消防! :)




错了


px是没用的......它会导致可访问性问题[lems而你没办法

预测它的外观无论如何......它们更好,但是主要用于它们是非文本元素与文本大小相关


在大多数情况下最好的选择是将主体文本保留为默认大小

并使用%定义更大和更小的文本...这是最可预测的和

无障碍方法


-

eric
www.ericjarvis.co.uk

活得快,只有在必要时才会死


"布赖恩" <我们***** @ mangymutt.com.invalid-除去-这部分>在消息中写道

新闻:TWGcb.431331


Simple question... which is better to use for defining font sizes and why?
px and em seem to be the leading candidates. I know what the general answer
is going to be, but I''m hoping to ultimately get some good real world
examples.

Fire away! :)

Regards,
Peter Foti

解决方案

Peter Foti wrote:

Simple question... which is better to use for defining font sizes
em
and why?
For reasons discussed in ciwas *numerous* times before. Google will
help you find them if you haven''t already read them.
I know what the general answer is going to be,
Then why pose the question? Seems like an waste of your time.
but I''m hoping to ultimately get some good real world examples.



examples of sites that use em for font-size? Ok, here''s two:

http://www.julietremblay.com/
http://people.umass.edu/btrembla/

--
Brian
follow the directions in my address to email me


Peter Foti wrote:

Simple question... which is better to use for defining font sizes and why?
px and em seem to be the leading candidates. I know what the general answer
is going to be, but I''m hoping to ultimately get some good real world
examples.

Fire away! :)



wrong

px is no use...it causes accessibility pro[lems and you have no way of
predicting it''s appearance anyway...em is better, but the main use for em
is in relating non text elements to text size

the best bet in most cases is to leave main body text as the default size
and define larger and smaller text with %...it is the most predictable and
accessible method

--
eric
www.ericjarvis.co.uk
"live fast, die only if strictly necessary"


"Brian" <us*****@mangymutt.com.invalid-remove-this-part> wrote in message
news:TWGcb.431331


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

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