Self-adapting problem of mobile web

Source: Internet
Author: User

Self-adapting width of mobile phone

Add a bit of code to the head tag (insufficient, width adaptation, height is not necessarily suitable)

<meta name= "viewport" content= "width=device-width, initial-scale=1"/>
Viewport is the default width and height of the Web page

The above line of code means:

Web page width defaults to screen width (width=device-width),

The original scaling ratio (initial-scale=1) is 1.0,

That is, the initial page size accounted for 100% of the screen area.

Width=device-width: Indicates width is the width of the device screen

Height=device-height: Indicates height is the height of the device screen

initial-scale=1.0: Indicates the initial zoom ratio

minimum-scale=0.5: Represents the minimum zoom ratio

Maximum-scale=2.0: Represents the maximum zoom ratio

User-scalable=yes: Indicates whether the user can adjust the zoom ratio

Self-adapting problem of mobile web

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.