懂者自懂
<!DOCTYPE> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0"> <script> var scale = 1 / devicePixelRatio; document.querySelector('meta[name="viewport"]').setAttribute('content','initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no'); let deviceWidth = document.documentElement.clientWidth; document.documentElement.style.fontSize = deviceWidth / 7.5+ 'px'; </script> <style> body { font-size:14px; } </style> </head> <body> </body> </html>