For work needs, I need to make a mobile phone adaptive web page effect. Finally got it done, share and record it first! In fact, the main thing is to change the HTML page declaration: Add the following code to the web page and it will display normally: Copy code The code is as follows:<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/> explain: width - the width of the viewport height - the height of the viewport initial-scale - the initial scale minimum-scale - the minimum scale the user is allowed to zoom to maximum-scale - The maximum scale to which the user is allowed to zoom user-scalable - whether the user can manually scale To simplify it, you can change the above code to the following code, the effect is the same: Copy code The code is as follows:<meta content="width=device-width,user-scalable=no" name="viewport"> Finally, don’t set a specific width attribute that is too large. For example, if you set the Body width attribute to 1000px on a web page, this is definitely not acceptable. However, you can set it to 90%, which is screen adaptive. PS: I made an effect page, which can be displayed normally on a mobile phone. |
<<: In-depth analysis of Flex layout in CSS3
>>: Summary of various postures of MySQL privilege escalation
Table of contents Preface: 1. Concept 2. The bene...
FOUC is Flash of Unstyled Content, abbreviated as ...
Under the requirements of today's responsive ...
Recently I changed Apache to nginx. When I moved ...
Method 1 Copy code The code is as follows: documen...
For example, when you create a new table or updat...
Table of contents 1. typeof 2. instanceof 3. Cons...
The time of VM Ware virtual machine centos is inc...
The difference between relative and absolute in H...
Table of contents 1 Indicators in stress testing ...
This article example shares the specific code of ...
Table of contents Case scenario Solving the probl...
Install SSHPASS For most recent operating systems...
Due to work requirements, I recently spent some t...
https://docs.microsoft.com/en-us/windows/wsl/wsl-...