Mobile page First attempt (i)

Source: Internet
Author: User

The first time you write a mobile page

1, basically in the head of the Web page we just add four meta tags to achieve a mobile site framework. Let me take a look at the meta tags.

<meta name= "viewport" content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>

Detailed properties:

Width  ----  viewport (width=device-width meaning: Width equals device width)  height------viewport (height= Device-height means: Height equals device width) initial-scale-----The initial scaling minimum-scale-----The minimum scale that allows the user to zoom Maximum-scale----- Allows the user to zoom to the maximum scale user-scalable-----whether the user can scale manually

2. Prohibit numbers from being changed to phone numbers

<meta name= "format-detection" content= "Telephone=no"/>

In general, iOS and Android will default to a certain length of number as the phone number, even if not added will default to display as the phone, so, cancel this is necessary!

3. Safari private meta tag in iphone device

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

It says: Allow full screen mode to browse, hide browser navigation

4. iphone private Label

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

It specifies that the status bar style at the top of safari in the iphone defaults to default white to position black black and black-translucent (gray translucent)

<link rel= "apple-touch-icon-precomposed" href= "Http://3gimg.qq.com/wap30/info/info5/img/logo_icon.png" >

This is a personalized link tag, he supports the user to create a shortcut to the desktop icon for our own defined icon

Apple-touch-icon.png or Apple-touch-icon-precomposed.png, the former named iOS will automatically add rounded, shaded, and highlighted overlays for this icon, which will not add these effects.

II. Basic framework of mobile website Framework Code

<!doctype html>

Third, on the mobile site debugging problems

Generally we use: in the browser debugging + Real machine testing, because the browser is only a simulation tool, the actual development, we have to use the real machine to test.

For example: (Android phones, IPhone5, 5s, 6, 6Plus ...) )

And in the browser test, you can chrome (Google browser) F12 Debugging tools: There is a small phone-like icon, click to simulate the phone test.

Mobile page First attempt (i)

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.