使用&QUOT大小字体;环监QUOT;还有用吗? [英] Is sizing fonts using "em" still relevant?

查看:159
本文介绍了使用&QUOT大小字体;环监QUOT;还有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你们谁使用的 EM 的大小字体都知道,与嵌套元素打交道,而不必进行时,他们可有头痛时的 PX 的 - > EM 的计算(以保证您的设计间pretation是正确的@ 100%)消耗额外的时间。

Those of you who use em when sizing fonts will know that they can be a headache when dealing with nested elements, and having to make the px -> em calculations (to ensure your design interpretation is correct @ 100%) consumes extra time.

使用这些(诚然,未成年人)的问题在心中,并给出了主要的浏览器都对解决访问问题本身处理,如页面缩放最近取得的进展/缩放,使用的 EM 的大小字体仍考虑是否值得? *

With these (admittedly minor) issues in mind, and given the recent progress the major browsers have made towards natively dealing with accessibility issues such as page scaling / zooming, is using em to size fonts still considered worthwhile? *

*旧版浏览器(IE6)的支持排除。

*legacy browser (IE6) support excluded.

推荐答案

不要为屏幕样式指定字体大小的绝对长度单位。它们不一致渲染跨平台和不能由用户代理(例如浏览器)被调整。保持这样的单位的使用情况造型上的媒体与固定且已知的物理特性(例如打印)

Do not specify the font-size in absolute length units for screen stylesheets. They render inconsistently across platforms and can't be resized by the User Agent (e.g browser). Keep the usage of such units for styling on media with fixed and known physical properties (e.g print)

如果你使用这种方法,不需要计算

If you will use this method, no need to calculate

可以身体的字体大小设置为62.5%(即16像素的默认的62.5%),这相当于为10px,或0.625EMs。现在你可以用一个简单的设置字体大小在新兴市场要记得转换,除以10像素。

You can set the font-size of the body to 62.5%(that is 62.5% of the default of 16px), which equates to 10px, or 0.625EMs. Now you can set your font-size in EMs with an easy to remember conversion, divide the px by 10.

* 12px = 1.2EMs
* 13px = 1.3EMs
* 16px = 1.6EMs
* 8px = 0.8EMs
* etc…

这使得一切SUPER容易记住并消除了转换表的需要。当然,你仍然需要使用EMS的时候,如果你没有被具体在你的CSS,这是一个完全独立的问题,使用一个转换表嵌套元素。

This makes everything SUPER easy to remember and eliminates the need for conversion tables. Of course, you will still need to use a conversion table for nested elements when using EMs, if you are not being specific in your CSS, which is a whole separate issue.

但是,76%要好得多,你可以用它来计算 http://pxtoem.com/

是它仍然是相关的:

IE6仍然是应用广泛,是无法调整的PX定义的字体。 =>可用性问题。这仅仅是一个没有没有。

IE6 is still widely used and is unable to resize the fonts defined in px. => Usability issues. That alone is a no-no.

IE 7和8不调整文字与像素大小两种,其实。他们有网页缩放,但有些人preFER到incease只有文字的大小。

IE 7 and 8 don't resize text sized with pixels either, actually. They do have page zoom, but some people prefer to incease text size only.

下面是一个什么样的好坏对一般的字体大小的总结。

Here's a summary of what's good and bad about font sizing in general.

我个人喜欢的EMS。其他的,像克里斯Coyier了在CSS-Tricks.com喜欢像素。 (克里斯对不同的字体单元的优秀文章)。

I personally like ems. Others, like Chris Coyier over at CSS-Tricks.com likes pixels. (Chris has an excellent article on the different font units).

这真的归结为个人的preference。

It really comes down to personal preference.

几乎类似或相关的问题,以便

<一个href=\"http://stackoverflow.com/questions/1890970/should-we-still-use-em-and-for-defining-the-font-size-of-the-website-elements\">Should我们仍然使用EM和%用于定义网站元素的字体大小?

<一个href=\"http://stackoverflow.com/questions/293247/is-there-really-any-point-to-using-relative-font-sizing-in-css\">Is真的有任何一点使用相对字体的大小CSS?

为什么EM而不是PX?

字体大小在CSS - %或EM

<一个href=\"http://stackoverflow.com/questions/520939/css-font-size-relative-vs-absolute-values-which-to-use\">CSS字体大小:相对与绝对的值。使用哪一个?

问题的EM

用em单位问题

http://pxtoem.com/

http://riddle.pl/emcalc/

<一个href=\"http://convert-to.com/pixels-px-to-em-conversion.html\">http://convert-to.com/pixels-px-to-em-conversion.html

从PX转换整个网站EM(这个工具仍在开发中)

Convert entire site from px to em (This tool is still in development)

http://converter.elementagency.com/

EM计算器AIR应用程序(将在所有OS工作)

<一个href=\"http://jameswhittaker.com/journal/em-based-layouts-vertical-rhythm-calculator/\">http://jameswhittaker.com/journal/em-based-layouts-vertical-rhythm-calculator/

<一个href=\"http://jameswhittaker.com/projects/apps/em-calculator-air-application/\">http://jameswhittaker.com/projects/apps/em-calculator-air-application/

Windows应用程序

<一个href=\"http://www.thebrightlines.com/2009/11/16/pixem-pixel-to-em-converter/\">http://www.thebrightlines.com/2009/11/16/pixem-pixel-to-em-converter/

http://www.storkas.com/Projects.aspx(go 底部)

像素埃姆斯转换表CSS

<一个href=\"http://jontangerine.com/silo/css/pixels-to-ems/\">http://jontangerine.com/silo/css/pixels-to-ems/

<一个href=\"http://reeddesign.co.uk/test/points-pixels.html\">http://reeddesign.co.uk/test/points-pixels.html

emchart

http://aloestudios.com/tool​​s/emchart/

http://aloestudios.com/$c$c/emchart/

在这个问题上的一些更多的文章

<一个href=\"http://www.d.umn.edu/itss/support/Training/Online/webdesign/type.html\">http://www.d.umn.edu/itss/support/Training/Online/webdesign/type.html

这篇关于使用&QUOT大小字体;环监QUOT;还有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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