How to solve the problem that the whole relative screen shrinks when the mobile phone visits the website

Source: Internet
Author: User
Tags reference relative

Development of their own web site, on the mobile phone, always a small piece of the whole, not very good to adapt to the screen, each time to use their fingers to enlarge to the appropriate size, and found that the need to add in the development code:

<meta name= "viewport" content= "Width=device-width, initial-scale=1" > (can be added to the first line)

Parameter description:

The height of the width-viewport width height-viewport

Initial-scale-Initial scaling ratio

Minimum-scale-The minimum scale that allows the user to scale

Maximum-scale-Allows the user to zoom to the maximum scale

User-scalable-whether the user can scale manually

This parameter describes the reference: http://www.2cto.com/kf/201308/240021.html

If you want to open a Web page automatically in the original proportions and do not allow the user to modify, you are:

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

================================================ [Another method]

Take this paragraph

<! DOCTYPE ........>

Replace with this paragraph

<! DOCTYPE HTML PUBLIC "-//wapforum//dtd XHTML Mobile 1.0//en" "Http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >

Note: This method in the iphone horizontal screen when the width will exceed the screen width of the scroll bar, the solution is to add method one of the code

Reference: http://www.strongfire.cn/article/319.html

Author: csdn Blog Shell

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/Skills/

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.