Solve the Problem of HTML5 mobile terminal page scaling, html5 mobile phone 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
Summary
The above section describes how to scale pages on HTML5 mobile phones. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!