解决方法
[更新]所以今天马克Otto回答我上面提到的线程。可以预见,没有提及的可达性和使用短语“像素完美”:
Okay,so here’s a bit of a background on the decisions of yesteryear
and plans for moving forward.Pixels provide absolute control and consistent rendering across every
browser.Designers still mostly think and operate in pixels.
Browsers
scale up entire pages these days,so it’s not an issue with type
scaling or anything.Nesting ems historically has been a pain and can require extra math for figure computed/intended pixel values.
Mixing units of measurements is ugly and my inner OCD hates it.
Using units on line-height is generally discouraged,but provides immediate
knowledge of what the computed value is. We’ll probably try to steer
away from this in the future.
In the future,we’ll likely use ems for type sizing,perhaps rems even,but not for anything else. This is also debatable on font sizes for inputs and the like. It’s just not how folks build pixel perfect sites.That’s a bit all over and hopefully coherent enough. I’ll try to blog about these changes as they come up more,but I’m unsure how close 3.0 is and what that will all entail yet.
我建议任何人有强烈的感觉这一点和1 this thread。
[更新] 07路线图V2.3 release blogpost中没有提到添加支持ems。
[更新]了解有关Bootstrap V3的更多信息,请求here包括以下来自Mark Otto:
We explored the use of rem units over pixels,but found little benefit
to offset the implications of their use. IE8 would still need a pixel
fallback,and that’s a lot of duplicate lines of code. Moreover,using
rems everywhere instead of pixels would exacerbate that problem.
Mixing rems and pixels doesn’t seem to make sense either right now.
However,we can and will continue to evaluate this in future releases.
然后最近(在其评论):
I highly doubt we’ll be shipping with rems at this point. Changing
everything—beyond font-sizes—is a huge task and one that comes with
few benefits to offset that. Double the lines of code for font-sizes
aside,supporting rems in any other way seems tedious at best. That
said,we can always revisit in a future release. For now,we’re
sticking with pixels.
对大量的Bootstrap的功能不满意,特别是缺乏em支持,我强烈建议看Susy如果你只是想要网格,或者Zurb Foundation 4为整个enchilada。不要让Bootstrap的受欢迎程度影响你的判断。任何人都可以使用Bootstrap构建一个东西,这正是它的问题 – 它是为最小的web体验的人设计的。只是因为有很多麦当劳在世界上并不意味着它是一个健康的地方吃。
[编辑]这是一个蠢的事情要说。自从我写这个,我使用BS3,它已经提高了它的游戏相当。我不应该这样一个一次性的评论,但我仍然认为它使用像素的字体大小做了一个坏的决定。除了辅助功能问题,ems在其他方面很有用。
For those following along,we’ll be able to change from pixels to REMs in v4 when we drop IE8 support. Can’t do much until then.