Some tips for mobile development

Source: Internet
Author: User

Avoid text font size reset

html{

-webkit-text-size-adjust:100%;

-ms-text-size-adjust:100%;

text-size-adjust:100%;

}

Second, the size of the viewport

For some older browsers you need to use the following code:

<meta name= "handeldfriendly" content= "true" >

For Microsoft's PocketPC, you need to use a special property setting

<meat name= "mobileoptimized" content= ">"

The complete code is as follows:

<meta name= "handeldfriendly" content= "true" >

<meta name= "mobileoptimized" content= ">"

<meta name= "viewport" content= "Width=device-width" >

In addition to about scaling properties

<meta name= "viewport" content= "Width=device-width, initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0" >

The problem of text enlargement after Safai horizontal screen

Metas[i].content= "width=device-width,minimum-scale=0.25,maximum-scale=1.6";

Third, iphone full-screen mode start

Full screen boot, hide toolbar, address bar, and bottom status bar

<meta name= "apple-mobile-web-app-capable" content= "yes" >

The purpose of this code is to display a status bar at the top of the browser

<meta name= "Apple-mobile-web-app-status-bar-style" content= "Black" >

Displays a loading interface when the program starts and loads, telling the user that the program is loading

〈link rel= "Apple-touch-starup-image" href= "Img/1/splash.png" >

Iv. prevent iOS in focus is auto-scaling

$ (' Input,select,textarea '). Bind (' focus blur ', function (event) {

$viewportMeta. attr ("Content", ' width=device-width,initial-scale=1,maximum-scale= ' + (event.type== ' blur '? 10:1) ");

})

V. Prohibition and restriction of partial webkit characteristics

A. Disable automatic conversion to dial-up links. Nocallout{-webkit-touch-callout:none;

b, modify the background color after the click *{-webkit-tap-highlight-color:rgba (0,0,0,0);}

C, let the interface element content editable P{-webkit-appearance:none}

D, add ellipsis function for narrow screen. Ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}

Some tips for mobile development

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.