HTML5 Mobile Page Scaling
When writing HTML5 mobile phone pages, we will find that the proportions of the elements displayed on the pages are incorrect. What we need to add at this time is:
<Meta name = "viewport" content = "width = device-width, initial-scale = 1">
Or
<Meta name = "viewport" content = "width = device-width, initial-scale = 1.0, minimum-scale = 0.5, maximum-scale = 2.0, user-scalable = yes "/>
Then we will explain this sentence as follows:
Viewport: indicates the display window;
Width = device-width, initial-scale = 1.0: indicates that the display window width is equal to the screen width of the device. initial-scale = 1.0, that is, the initial scaling ratio is 1.0;
Minimum-scale: minimum scale allowed
Maximum: indicates the maximum scale allowed.
User-scalable: Indicates whether to allow users to scale pages. The value can be yes or no.
Instance problems:
Symptom:
When you click the input box on the mobile phone page to edit the text, the page is automatically enlarged.
Solution:
Insert in the header
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
Or the user-scalable = no