(function () {
var docEl = document.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth;
//这里是假设在640px宽度设计稿的情况下,1rem = 20px;可以根据实际需要修改
docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
};
recalc();
if (!document.addEventListener) return;
window.addEventListener(resizeEvt, recalc, false);
})();

初始化html font-size的更多相关文章

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

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

  2. Java ArrayList调用构造方法传入"容量size"不生效,如何初始化List容量size

    创建一个ArrayList对象,传入整型参数 @Test public void arrayListConstructor(){ ArrayList<Object> objects = n ...

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

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

  4. GetPropInfo Font Size

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

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

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

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

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

  7. UIAlertController custom font, size, color

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

  8. Phone Font Size

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

  9. PyCharm Change Font Size

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

  10. 【hihoCoder】1288 : Font Size

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

随机推荐

  1. oracle添加序列

    原文地址 http://blog.itpub.net/24099965/viewspace-1116923/ 1.创建.删除 create sequence seq_newsId increment ...

  2. 局部敏感哈希算法(Locality Sensitive Hashing)

    from:https://www.cnblogs.com/maybe2030/p/4953039.html 阅读目录 1. 基本思想 2. 局部敏感哈希LSH 3. 文档相似度计算 局部敏感哈希(Lo ...

  3. css Grid布局

    CSS Grid 布局完全指南(图解 Grid 详细教程)https://www.html.cn/archives/8510#prop-grid-gap 5分钟学会 CSS Grid 布局https: ...

  4. 三大框架整合模板ssh

    1.web.xml配置 <!-- 让spring随web启动而创建的监听器 --> <listener> <listener-class>org.springfra ...

  5. 错误信息: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

    这个错误主要原因是:数据库的配置出问题,比如写错库名什么的,仔细检查下.

  6. HDFS写机制

    HDFS写机制: 1.client客户端调用分布式文件系统对象DistributedFileSystem对象的create方法,创建一个文件输出流FSDataOutputStream对象. 2.Dis ...

  7. 012——软件安装之_matlab2019安装

    (一)参考文献:https://www.isharepc.com/14196.html (二)下载地址: 链接:https://pan.baidu.com/s/1gq06TuBWGr1Qc4owpRX ...

  8. mysql在group by分组后查询第二条/第三条乃至每组中任意一条数据

    昨天老板让我查询项目中(众筹),没人刚发起感召后,前三笔钱的入账时间和金额,这把大哥整懵逼了,group by在某些方面是好使,但这次不能为我所用了,获取第一笔进账是简单,可以用group by 直接 ...

  9. apt-get linux 虚拟机安装vm tools下载

    要重启机器才行D:\Program Files (x86)\linux.iso解压tar zxvf VMwareTools-9.9.0-2304977.tar.gz

  10. 猴猴的比赛 dfs序

    猴猴的比赛 dfs序 两颗\(n\)节点的树,不相同,问多少点对\((u,v)\)在两棵树上均满足路径\(v\)在\(u\)子树中 \(n\le 10^5\) 暴力: \(n^2\)暴力枚举点对用\( ...