为什么要使用html,body{font-size:62.5%}?

使用以下代码查看浏览器的初始font-size:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
  <script type="text/javascript">
    var style = document.body.currentStyle || document.defaultView.getComputedStyle(document.body, '')
    console.log(style.fontSize);
  </script>
</body>
</html>

我在不同的浏览器,包括用谷歌浏览器模拟手持设备,得到的值都是16px;

html{font-size:62.5%;}表示设置浏览器文字大小初始值为10px,方便 'px' 转 'em' 或 'px' 转 'rem' 的单位换算。

html{font-size:62.5%}的更多相关文章

  1. hiho #1288 微软2016.4校招笔试题 Font Size

    #1288 : Font Size 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Steven loves reading book on his phone. The ...

  2. LaTeX :font size 修改字体大小的几种方式

    调整字体大小的几种方式,大小依次增大,具体如下: \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \hu ...

  3. GetPropInfo Font Size

    设置font size,遍历所有控件,有的控件没有font属性,所以要用GetPropInfo判断 if (GetPropInfo(cmp, "font")) function G ...

  4. unity UGUI text font size对性能影响较大

    Font Size对ugui text的性能影响非常大. <Cube Duck Run>在itouch5上测试是很流畅的,但是在iphone5上测试,在game over后显示历史最高分时 ...

  5. XE6 c++builder 设置 font size GetPropInfo SetOrdProp

    PPropInfo ppi; PTypeInfo pti; TTypeKinds ttk; TRttiContext context; TRttiType *rttiType TObject* obj ...

  6. UIAlertController custom font, size, color

    本文转载至 http://stackoverflow.com/questions/26460706/uialertcontroller-custom-font-size-color up vote2d ...

  7. Phone Font Size

    This table lists and describes the various font sizes that can be applied. Attribute = FontSize   Na ...

  8. PyCharm Change Font Size

    file->settings->colors&fonts-> save as (save the current scheme as your own)-> font- ...

  9. 【hihoCoder】1288 : Font Size

    题目:http://hihocoder.com/problemset/problem/1288 手机屏幕大小为 W(宽) * H(长),一篇文章有N段,每段有ai个字,要求使得该文章占用的页数不超过P ...

  10. LaTex Font Size 字体大小命令

    LaTex中字体大小有很多中等级,分别由下列命令控制: \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE ...

随机推荐

  1. 版本控制-Git对象

    Git对象 版本控制在于文件的控制,git的控制方法在于为每个文件生成(key,object)的结构.git利用sha-1加密算法,对每一个文件生成一个唯一的字符序列(明文大小不超过2^64位,对于普 ...

  2. datatable 分页实例

    1.使用datatable前台分页,需要后台返回全部数据,返回lisit 2.如果是后台分页 则后台需要获取分页参数,页面中要加 "searchable":true,  " ...

  3. C#利用substring按指定长度分割字符串

    这几天学习分析声音的波形数据,接收到的是十六进制的数据,需要将数据转换成十进制再绘图,这个过程涉及到字符串的分割,正好可以促进自己对C#相关知识的学习.说到分割字符串,我首先想到的是Split,但根据 ...

  4. app图标icon大全

    http://tool.58pic.com/tubiaobao/index.php?m=Index&a=ui&p=2 很有用,下载没用,直接右键吧.

  5. chkconfig命令核心案列及核心原理

    chkconfig sshd on  设置sshd开机自启动 chkconfig sshd off  设置sshd开机不启动 chkconfig --level 35 sshd on    设置ssh ...

  6. springboot如何测试打包部署

    有很多网友会时不时的问我,spring boot项目如何测试,如何部署,在生产中有什么好的部署方案吗?这篇文章就来介绍一下spring boot 如何开发.调试.打包到最后的投产上线. 开发阶段 单元 ...

  7. css系统学习网站

    最近系统学习一下css样式,找到一个不错的网站.http://css.doyoe.com/

  8. 解决linux安装软件:/lib/ld-linux.so.2: bad ELF interpreter问题

    问题:64位系统中安装了32位程序解决办法 是因为64位系统中安装了32位程序 解决方法: yum install glibc.i686

  9. ubuntu下ftp服务

    (1).首先用命令检查是否安装了vsftpd vsftpd -version 如果未安装用一下命令安装 sudo apt-get install vsftpd 安装完成后,再次输入vsftpd -ve ...

  10. susmote个人网站博客论坛(TexTec | 关注互联网技术,传播极客精神)

    网站地址 www.susmote.com www.textec.club 欢迎您的访问