我们还应该使用em和%来定义网站元素的字体大小吗? [英] Should we still use em and % for defining the font-size of the website elements?

查看:136
本文介绍了我们还应该使用em和%来定义网站元素的字体大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现很多关于使用不同的字体大小和网站的度量单位的建议。他们中的大多数人建议在%(100.1%)中定义主体字体大小,并使用em作为其余部分。我意识到这是非常有用的保存比例放大和缩小,特别是对于旧版浏览器。但是现在大部分网页浏览器都可以限制网页元素的比例,即使是固定大小的元素也是如此。所以我们还是应该使用%和em,否则我们可以使用像素。



谢谢。

解决方案

正在分配字体大小。你是对的新的浏览器放大,但不是每个人都升级他们的浏览器,并容纳视力受损总是一件好事情。


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.

解决方案

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.

这篇关于我们还应该使用em和%来定义网站元素的字体大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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