Home > Web Front-end > CSS Tutorial > How to use CSS3 media queries

How to use CSS3 media queries

php中世界最好的语言
Release: 2017-11-24 11:58:08
Original
2012 people have browsed it

The

media query function of css3 enables responsive layout to be realized. In fact, the basic principle is to use the css3 media query (media/meta) function to find out the size of the device, and then write Write or overwrite css styles in different sizes to change the appearance of the interface. Next, let me tell you how to use CSS3 media queries.

esponsive Web Design

Integrate existing development skills (elastic grid layout, elastic images, media and media queries)

Integrated, named responsive web design

is a display mechanism for "perfect" layout of web content for any device.

In short, a website can be compatible with multiple terminals - rather than making a specific version for each terminal.

Advantages

The multi-terminal visual and operating experience is very consistent

Compatible with current and future new devices

Most technologies in responsive web design can Used in WebApp development

It saves development costs and reduces maintenance costs a lot

Insufficiency

Compatibility: There is a problem with the compatibility of lower version browsers

Mobile Bandwidth Traffic: Compared with mobile phone customized websites, the traffic is slightly larger,

but compared to loading a complete PC-side website, it is obviously much smaller

The code is cumbersome, and there will be hidden useless elements. Longer loading time

Compatible with various devices and heavy workload

Mobile first

In the early stages of design, we must consider how the page will be displayed on multiple terminals

Progressive enhancement

Maximize the functionality of hardware devices

What is it suitable for?

For content-heavy websites, such as image display, it is more suitable to use responsive web design

What is not applicable?

For websites with heavy functions, such as e-commerce, it is more recommended to use independent mobile websites

CSS3-media Query

javascript

Third-party open source framework

 ​ Bootstrap

Common property operations

device-width/ device-height Device screen width and height

width/height (Rendering window width) Actual display width

resolution Device resolution

orientation Device orientation

portrait /landscape Portrait or landscape screen

initial-scale Set the initial zoom ratio of the page (0-10.0)

user-scalable Set whether the user can zoom (yes/no)

Minimum-SCALE setting the minimum reduction ratio (0-10.0)

Maximum-SCALE set the maximum amplification ratio (0-10.0)

## , for more exciting content, please pay attention to other related articles on the php Chinese website!

Related reading:

How to use the text-shadow font shadow of CSS3

How to choose the appropriate HTML tag

What should you pay attention to when centering a div in html

The above is the detailed content of How to use CSS3 media queries. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template