当前位置:网站首页>移动端页面使用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
边栏推荐
- MATLAB R2022a 安装教程
- 显示屏DIN 4102-1 Class B1防火测试要求
- SAP OData development tutorial
- Standardized compilation knowledge
- SAP abap 字段符号
- MySQL启动报错“Bind on TCP/IP port: Address already in use”
- Codetop - sort odd ascending even descending linked list
- MySQL核心点笔记
- Using docker compose to build redis5 cluster
- Display DIN 4102-1 Class B1 fire test requirements
猜你喜欢

Standardized compilation knowledge

【C语言-数据存储】数据在内存中是怎样存储的?

leetcode - 739. Daily temperature

SAP ODATA 开发教程

M1 芯片指南:M1、M1 Pro、M1 Max 和 M1 Ultra

面试官问了四个问题,总结了4个经验

Matlab学习7-图像处理之线性平滑滤波

Matlab学习9-图像处理之非线性锐化滤波

Sword finger offer 51 Reverse pair in array

Screening frog log file analyzer Chinese version installation tutorial
随机推荐
MATLAB R2022a 安装教程
What are the requirements of the drive housing UL 2043?
String类为何final修饰
使用express+mysql创建一个基于nodejs的后台服务
The interviewer asked four questions and summed up four experiences
Analysis of EN 45545 R24 oxygen index test method
typescript高阶特性一 —— 合并类型(&)
TextView文本大小自动适配与TextView边距的去除
File system check of the root filesystem failed
[node] NPM part
智能控制理论小题库
显示屏DIN 4102-1 Class B1防火测试要求
Screening frog log file analyzer Chinese version installation tutorial
Mazhiqiang: research progress and application of speech recognition technology -- RTC dev Meetup
How many items should the indoor intumescent fire retardant coating meet according to BS 476-21 fire resistance standard?
E. Zoom in and zoom out of X (operator overloading)
九九乘法表
面試題 02.02. 返回倒數第 k 個節點
马志强:语音识别技术研究进展和应用落地分享丨RTC Dev Meetup
(2) Analysis of AAC source code from the perspective of architecture design - my livedata