当前位置:网站首页>移动端页面使用rem来做适配
移动端页面使用rem来做适配
2022-06-11 08:57:00 【WebCsDn_TDCode】
index.html添加此代码
fnResize()
window.onresize = function() {
fnResize()
}
function fnResize() {
var deviceWidth = document.documentElement.clientWidth || window.innerWidth
if (deviceWidth >= 750) {
deviceWidth = 750
}
if (deviceWidth <= 320) {
deviceWidth = 320
}
document.documentElement.style.fontSize = (deviceWidth / 7.5) + 'px'
}
按照UI 750比例 100px = 1rem
边栏推荐
- Port occupancy problem, 10000 ports
- 处理RAW格式的图像,需要什么软件?
- How to apply for ASTM E108 flame retardant test for photovoltaic panels?
- Getting started with Zipkin
- CMVSS TSD No. 302与49 CFR 571.302测试方法是否一样
- 2、 Rendering camera data
- M1 chip guide: M1, M1 pro, M1 Max and M1 ultra
- 光伏板怎么申请ASTM E108阻燃测试?
- What are the requirements of the drive housing UL 2043?
- SAP abap 字段符号
猜你喜欢

Sword finger offer 51 Reverse pair in array

SAP OData development tutorial

Textview text size auto fit and textview margin removal

File system check of the root filesystem failed

M1 chip guide: M1, M1 pro, M1 Max and M1 ultra

What is the process of en 1101 flammability test for curtains?

显示器要申请BS 476-7 怎么送样?跟显示屏一样吗

C language printing diamond

leetcode - 230. The k-th smallest element in a binary search tree

MATLAB R2022a 安装教程
随机推荐
Complete ES6 questions
Matlab learning 8- linear and nonlinear sharpening filtering and nonlinear smoothing filtering of image processing
剑指 Offer II 036. 后缀表达式
Sword finger offer II 036 Postfix Expression
Create a nodejs based background service using express+mysql
Livedata and stateflow, which should I use?
vagrant 安装踩坑
面试官问了四个问题,总结了4个经验
剑指 Offer 18. 删除链表的节点
SQL basic query
CMVSS TSD No. 302与49 CFR 571.302测试方法是否一样
智能控制理论小题库
木板ISO 5660-1 热量释放速率摸底测试
206. reverse linked list
SAP OData development tutorial
[237. delete nodes in the linked list]
SAP ABAP field symbol
利用docker-compose搭建redis5集群
Are the test methods of CMVSS TSD No. 302 and 49 CFR 571.302 the same
Wood board ISO 5660-1 heat release rate mapping test