1. Prevent the Web page from enlarging and shrinking in mobile phone
<meta name= "viewport" content= "width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
2. Start or disable the phone number in the auto-identify page
<meta name= "format-detection" content= "Telephone=no" >
3, HTML5 call the Android or iOS dialing function
<a href= "tel:4008106999,1034" >400-810-6999 turn 1034</a>
4, pull the scroll bar up and down, slow
body { -webkit-overflow-scrolling:touch; Overflow-scrolling:touch;}
5. Prohibit copying and selecting text
Element { -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none; User-select:none;}
6, long time to press and hold the page flash back
element { -webkit-touch-callout:none;}
7. The default inner shadow of the input box under iphone and ipad
element{ -webkit-appearance:none;}
8. Translucent gray Matte when touching elements under iOS and Android
Element { -webkit-tap-highlight-color:rgba (255,255,255,0)}
9, active compatibility processing is pseudo-class: Active failure
Method One: Body add ontouchstart<body ontouchstart= "" > method two: JS to document binding Touchstart or Touchend event <style>a {color: # 000;} a:active {color: #fff;} </style><a herf=foo >bar</a><script> document.addeventlistener (' Touchstart ', function () {}, False);</script>
10. When rotating the screen, the font size adjustment problem
HTML, body, form, fieldset, p, Div, H1, H2, H3, H4, H5, h6 { -webkit-text-size-adjust:100%;}
11, some Android phone round corner failure
Background-clip:padding-box;
12. Top status bar background color
<meta name= "Apple-mobile-web-app-status-bar-style" content= "Black"/>
13. Canceling the cache
<meta http-equiv= "Cache-control" content= "No-cache"/>
14. Start Screen
<link rel= "Apple-touch-startup-image" href= "Start.png"/> Different sizes <!--iphone--><link href= " Apple-touch-startup-image-320x460.png "Media=" (device-width:320px) "rel=" Apple-touch-startup-image "/><!-- IPhone Retina--><link href= "Apple-touch-startup-image-640x920.png" media= "(device-width:320px) and (- Webkit-device-pixel-ratio:2) "rel=" Apple-touch-startup-image "/><!--iPhone 5--><link rel=" Apple-touch-startup-image "Media=" (device-width:320px) and (device-height:568px) and (-webkit-device-pixel-ratio:2) "Href=" Apple-touch-startup-image-640x1096.png "><!--iPad portrait--><link href=" Apple-touch-startup-image-768x1004.png "Media=" (device-width:768px) and (orientation:portrait) "Rel=" Apple-touch-startup-image "/><!--iPad landscape--><link href=" Apple-touch-startup-image-748x1024.png " Media= "(device-width:768px) and (Orientation:landscape)" rel= "Apple-touch-startup-image"/><!--iPad Retina Portrait--><link Href= "Apple-touch-startup-image-1536x2008.png" media= "(device-width:1536px) and (orientation:portrait) and (- Webkit-device-pixel-ratio:2) "rel=" Apple-touch-startup-image "/><!--iPad Retina Landscape--><link href= "Apple-touch-startup-image-1496x2048.png" media= "(device-width:1536px) and (Orientation:landscape) and (- Webkit-device-pixel-ratio:2) "rel=" Apple-touch-startup-image "/>
15. Special Browser Private
QQ Browser Private Full screen mode <meta name= "X5-fullscreen" content= "true" > Force vertical screen <meta name= "X5-orientation" content= "Portrait" > Force horizontal screen <meta name= "x5-orientation" content= "Landscape" > Application Mode <meta name= "X5-page-mode" content= "App" > UC Browser private full screen mode <meta name= "Full-screen" content= "yes" > force vertical screen <meta name= "Screen-orientation" content= "Portrait" > Force horizontal screen <meta name= "screen-orientation" content= "Landscape" > Application Mode <meta name= "Browsermode" content= " Application ">
Other optimized for handheld devices, mainly for some older browsers that do not recognize viewport, such as BlackBerry <meta name= "handheldfriendly" content= "true" > Microsoft's old browser <meta name= "Mobileoptimized" content= ">windows" phone click No highlight <meta name= "Msapplication-tap-highlight" content= "no" >
16, iOS input keyboard event KeyUp, KeyDown, keypress support is not very good
Can use the HTML5 Oninput event to replace the KeyUp
<input type= "text" id= "Testinput" ><script type= "Text/javascript" > document.getElementById (' Testinput '). AddEventListener (' input ', function (e) { var value = E.target.value; }); </script>
17, iOS keyboard letter input, default first letter capitalization
<input type= "text" autocapitalize= "Off"/>
18. Click 300ms Delay on the mobile side
Fastclick, Tap.js, Zepto, Touchstart
19, Mobile end HTML5 audio AutoPlay failure problem
Document.addeventlistener (' Touchstart ', function () { document.getelementsbytagname (' audio ') [0].play (); document.getElementsByTagName (' audio ') [0].pause ();});
20. Remove input Default Style
Input[type=number] { -moz-appearance:textfield;} Input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button { - Webkit-appearance:none; margin:0;}
Mobile-Browser issues