标签:bsp cep win console har write idt min 移动端
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <!-- <meta name="viewport" content="width=device-width,initial-scale=.33333,minimum-scale=.33333,maximum-scale=.33333" /> --> <script> //获取像素比 //console.log(window.devicePixelRatio); var pixelRatio = 1 / window.devicePixelRatio; console.log(pixelRatio); //通过js动态设置视口(viewport) document.write(‘<meta name="viewport" content="width=device-width,initial-scale=‘+pixelRatio+‘,minimum-scale=‘+pixelRatio+‘,maximum-scale=‘+pixelRatio+‘" />‘); </script> </head> <body> </body> </html>
标签:bsp cep win console har write idt min 移动端
原文地址:https://www.cnblogs.com/smile-fanyin/p/14597515.html