<script> var pixclpation = 1/window.devicepixelration; document.write (' <meta name= ' viewport "content=" width=device-width,initial-scale= ' +pixelratio+ ', minimum-scale= ' +pixelratio+ ', maximum-scale= ' +pixelratio+ ' "/> '); </script>
1. Let the 1px do 1px things by setting the zoom ratio. This will not appear on different screens when the 1px display is not the case of 1px.
var html = document.getelementsbyname (' html ') [0];var pagewidth = Html.getboundingclientrect (). width; Html.style.fontSize = pagewidth/16 + ' px ';
2. Set EM so that the responsive layout is based on the font
html{ width:100%; height:100%; Overflow:hidden;} body{ width:100%; height:100%; Overflow:auto;}
3. Allow body to control the size of the page
a { // cancel the black mask layer that appears when a label finger is pressed -webkit-tap-highlight-color:transparent; Text-Decoration:none;} input{ // solve the problem of rounding the form elements in iOS -webkit-appearance:normal;}
Mobile-responsive layouts