微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

HTML – 如何计算?

我注意到你可以使用1em,它在不同的网站上看起来会有所不同.

什么是em比例?

>使用的字体?
>最大的字体大小?
>页面宽度/高度?

解决方法

http://w3schools.com/cssref/css_units.asp

1em is equal to the current font size. 2em means 2 times the size of
the current font. E.g.,if an element is displayed with a font of 12
pt,then ‘2em’ is 24 pt. The ’em’ is a very useful unit in CSS,since
it can adapt automatically to the font that the reader uses

EM与其定义的当前元素相关.如果使用相对大小(如0.9em),它们会相乘并导致意外的尺寸.

现在,字体的认大小在浏览器之间不是标准的.在将字体设置为特定像素单元时,IE(至少是较旧的IE)存在问题. A good overview for font sizing can be found on A List Apart.

原文地址:https://www.jb51.cc/html/232182.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐