标签:client attr details cto list sele set class 十分
理解:
应用:
那么,应该如何适配不同分辨率的手机呢?
适配方式:
@media screen and (min-width: 360px) {html{font-size:19.2px;}} @media screen and (min-width: 375px) {html{font-size:20px;}} @media screen and (min-width: 400px) {html{font-size:21.33333px;}} @media screen and (min-width: 414px) {html{font-size:22.08px;}} @media screen and (min-width: 440px) {html{font-size:23.46666px;}} @media screen and (min-width: 480px) {html{font-size:25.6px;}} @media screen and (min-width: 520px) {html{font-size:27.73333px;}} @media screen and (min-width: 560px) {html{font-size:29.86666px;}} @media screen and (min-width: 600px) {html{font-size:32px;}} @media screen and (min-width: 640px) {html{font-size:34.13333px;}} @media screen and (min-width: 680px) {html{font-size:36.26666px;}} @media screen and (min-width: 720px) {html{font-size:38.4px;}} @media screen and (min-width: 750px) {html{font-size:40px;}} @media screen and (min-width: 760px) {html{font-size:40px;}} @media screen and (min-width: 800px) {html{font-size:40px;}} @media screen and (min-width: 960px) {html{font-size:40px;}}
//视口设置 <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> var deviceWidth = document.documentElement.clientWidth; if(deviceWidth > 640) deviceWidth = 640; document.documentElement.style.fontSize = deviceWidth / 6.4 + ‘px‘;
var scale = 1 / devicePixelRatio; document.querySelector(‘meta[name="viewport"]‘).setAttribute(‘content‘,‘initial-scale=‘ + scale + ‘, maximum-scale=‘ + scale + ‘, minimum-scale=‘ + scale + ‘, user-scalable=no‘); document.documentElement.style.fontSize = document.documentElement.clientWidth / 10 + ‘px‘
https://blog.csdn.net/qq_34020571/article/details/78923089
标签:client attr details cto list sele set class 十分
原文地址:https://www.cnblogs.com/panjingshuang/p/12362686.html