1. To develop web responsively, the page must adapt to the screen size. You can use fluid layout, as in the previous article (adaptive width layout). Other specific minor problems can be solved by using media query (let IE support CSS3 Media Query to achieve responsive web design and CSS3 Media Queries). Copy code The code is as follows:<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" /> <meta content="yes" name="apple-mobile-web-app-capable" /> <meta content="black" name="apple-mobile-web-app-status-bar-style" /> <meta content="telephone=no" name="format-detection" /> The first meta tag means: force the document width to be 1:1 with the device width, and the maximum document width ratio is 1.0, and do not allow users to click on the screen to zoom in. The second meta tag is a private meta tag for Safari on iPhone devices, which means: allow full-screen mode browsing; The third meta tag is also a private tag for iPhone, which specifies the style of the status bar at the top of Safari on iPhone; The fourth meta tag means: Tell the device to ignore the numbers in the page as phone numbers. For examples, see: Common meta tag examples 4. Pay attention to the size of the link, because most of them are touch-screen phones, so users should be able to click on the label easily (I have seen an article before, but I can't find the source now. It seems that the minimum size is 42px*42px): The size of the operation object is in line with the finger operation, and the size of the key is set in accordance with the specification: 5. Graceful degradation (smooth degradation) should be achieved, and JS and images should be used less. The page should also reflect its value when users prohibit downloading JS and images (because many apps are set by default not to automatically download images and other resources under 3G). Copy code The code is as follows:/* Large desktop */ @media (min-width: 1200px) { ... } /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { ... } /* Landscape phone to portrait tablet */ @media (max-width: 767px) { ... } /* Landscape phones and down */ @media (max-width: 480px) { ... } 8. Of course, you can also jump to different URLs based on different terminals, see: JavaScript for mobile terminals such as mobile phones and tablets to adapt to jump URLs |
<<: Detailed explanation of the differences between similar tags and attributes in HTML
>>: CSS3 filter (filter) to achieve the sample code of gray or black mode of web page
Programs in Docker containers often need to acces...
Introduction 1.<iframe> tag: iframe is an i...
Problem Description 1. Database of the collection...
First: 4 ways to introduce CSS There are four way...
Table of contents Preface 1. What variables are p...
1. Package the Java project into a jar package He...
There are various environmental and configuration...
my.cnf is the configuration file loaded when MySQ...
If you forget your MySQL login password, the solu...
Table of contents 1. js memory 2. Assignment 3. S...
Table of contents Achieve results Available plugi...
1. Navigation: Unordered List vs. Other Label Ele...
After MySQL is installed, you can verify whether ...
A Thorough Analysis of HTML (14) Special Characte...
Recently, when I was writing web pages with PHP, I...