Should we still use em and % for defining the font-size of the website elements?

こ雲淡風輕ζ 提交于 2019-12-11 01:08:17

问题


I've found many suggestions on using different font-sizes and measure units for websites. Most of them suggest to define body font-size in % (100.1%) and use em for the rest part. I realize this is very useful for preserving the proportions while zooming in and out, especially for older browsers. But today most of the web browsers can constrain the proportions of website elements even for the fixed sized elements.

So should we still use % and em or we can use pixels?

Thank you.


回答1:


I still suggest using em when you are assigning font sizes. You're right about the newer browsers zooming in, but not everyone upgrades their browser, and accommodating the visually impaired is always a good thing.




回答2:


Internet Explorer 6 ( and 7? ) can't properly zoom for pixels so I would still rely on %/ems.



来源:https://stackoverflow.com/questions/1890970/should-we-still-use-em-and-for-defining-the-font-size-of-the-website-elements

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!