新建一个flex.js

! function () {
function t(t) {
return this.config = t, this
}
t.prototype = {
reset: function () {
var t = Math.min(document.documentElement.clientWidth, 750) / 750 * 100;
document.documentElement.style.fontSize = t + "px";
var e = parseFloat(window.getComputedStyle(document.documentElement).fontSize),
n = t / e;
/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) || document.documentElement
.setAttribute("flatform", "android"), 1 != n && (document.documentElement.style
.fontSize = t * n + "px")
}
}, window.Adapter = new t, window.Adapter.reset(), window.onload = function () {
window.Adapter.reset()
}, window.onresize = function () {
window.Adapter.reset()
}
}();

  引入页面,此时1rem=100px,我们就可以利用这个比例进行换算了。

最新文章

  1. HTML和CSS经典布局5
  2. asp.net 自带的缓存
  3. STC12C5A60S2笔记1(管脚定义)
  4. CEP简介
  5. ThindPad x230 无法U盘启动
  6. JavaScript基础-面向对象编程<1>
  7. AttributeError at /home/home/ Exception Type: AttributeError at /home/home/
  8. Struts2学习笔记①
  9. google官方的下拉刷新+自定义上拉加载更多
  10. android.intent.action.MAIN与android.intent.category.LAUNCHER
  11. linux下文件和目录
  12. GrideSearchCV 优化算法参数
  13. centos 7 防火墙操作
  14. wpf treeview 数据绑定 递归绑定节点
  15. [原][杂谈]如果人类的末日:"天网"出现
  16. 搭建SDN网络——mininet
  17. c++构造函数成员初始化中赋值和初始化列表两种方式的区别
  18. 基于Asp.net C#实现HTML转图片(网页快照)
  19. 如何添加使用echats地图悬浮显示内容
  20. swift 需求: 导航栏和HeaderView 使用一个背景图片。

热门文章

  1. centos git clone 报错 fatal: HTTP request failed 解决办法
  2. windows登录密码忘记了怎么办?
  3. Spring 如何解决循环依赖问题?
  4. 基于 CentOS 7 搭建 GitLab
  5. asp.net 9 ViewState
  6. Func<>委托、扩展方法、yield、linq ForEach综合运用
  7. linux core文件的打开和分析
  8. java面试5
  9. 【vue+axios】一个项目学会前端实现登录拦截
  10. 1 sql server 中cursor的简介