HTML5 Mobile Web Development Combat

Source: Internet
Author: User

1. Solve the change of the font size of the screen

HTML {            -webkit-text-size-adjust: 100%;             -ms-text-size-adjust: 100%;             text-size-adjust:100%;        }

2. Mobile viewport device width, no scaling

<name= "Viewport"  content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0 ">

3.CSS3 Media Query

Div {background: Red; height: 100px;} @media screen and         (min-width:480px){    //greater than 480px green            div{background: Green ;}         }

4. You can continue to use PX without EM

5. Solve the ancient mobile device browser does not recognize viewport

<Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0">    <Metaname= "handheldfriendly"content= "true"/>     <!--The old mobile device does not recognize the viewport attribute Plamos -    <Metaname= "Mobileoptimized"content= " the">       <!--Microsoft's PocketPC -

6. Solve the Safari font size change

<Script>          varMetas=document.getElementsByTagName ('Meta'); vari; if(Navigator.userAgent.match (/IPhone/i)) { for(i=0; I<metas.length; I++) {                    if(Metas[i].name== "Viewport") {metas[i].content= "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; }} document.addeventlistener ("Gesturestart", Gesturestart,false); }            functionGesturestart () { for(i=0; I<metas.length; I++) {                    if(Metas[i].name== "Viewport") {metas[i].content= "width=device-width, minimum-scale=0.25, maximum-scale=1.6"; }                }            }        </Script>

HTML5 Mobile Web Development Combat

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: 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.