Mobile Tips and optimization experience (online to see the summary of the province of the record)

Source: Internet
Author: User

1.meta fixed Statement
<meta name= "viewport" content= "Width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" >

The Width property controls how wide the device is, and device-width ensures that it renders correctly on different devices.
initial-scale=1.0 ensures that when the page loads, it is rendered at a scale of 1:1 without any scaling.

User-scalable=no can disable its zoom (zooming) feature.
Typically, maximum-scale=1.0 is used with User-scalable=no. By disabling the zoom feature, users can only scroll the screen to make your site look more like the native app.

Of course, when the specific situation, or according to the circumstances of their own needs, you want to disable the zoom function, add maximum-scale=1.0 and User-scalable=no. Do not write if you are not ready to disable.

2. Click on the element of a hyperlink, click Down, some phones will appear black shadow overlay, as well as the need to prohibit the system default menu and prohibit the selection of text, the solution:
A{-webkit-tap-highlight-color:transparent;  -webkit-touch-callout:none; -webkit-user-select:none;}

-webkit-tap-highlight-color:transparent; When you click on a hyperlink or clickable element, the value can be a color or a transparent transparent;
-webkit-touch-callout:none; Disables or displays the system default menu when you touch and hold the touch target. (on iOS, when you touch and hold a touch target, such as a link, the Safari browser will show the link about the system default menu.) )
-webkit-user-select:none; Suppresses the selection of text.

3. Useful @media
(Self-Baidu, hey hehe)

4. Mobile-side font size reference
html{font-size:10px}
@media screen and (min-width:321px) and (max-width:375px) {html{font-size:11px}}
@media screen and (min-width:376px) and (max-width:414px) {html{font-size:12px}}
@media screen and (min-width:415px) and (max-width:639px) {html{font-size:15px}}
@media screen and (min-width:640px) and (max-width:719px) {html{font-size:20px}}
@media screen and (min-width:720px) and (max-width:749px) {html{font-size:22.5px}}
@media screen and (min-width:750px) and (max-width:799px) {html{font-size:23.5px}}
@media screen and (min-width:800px) {html{font-size:25px}}

Mobile Tips and optimization experience (online to see the summary of the province of the record)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.