CSS Tutorial: CSS3 Media Queries Detailed

Source: Internet
Author: User
Tags min new features

Web page Production WEBJX article introduction: Speaking of the new features of CSS3, we have to mention Media Queries. This article is more detailed, so many of the actual use is not. So if you simply want to learn about media Queries, refer to CSS3 media Queries. CSS2.1 defines the Media section, including types, groups, and rules. CSS is not created for display purposes, but is applied to a variety of

Speaking of the new features of CSS3, we have to mention Media Queries.

This article is more detailed, so many of the actual use is not. So if you simply want to learn about media Queries, refer to CSS3 media Queries.

CSS2.1 defines the Media section, including types, groups, and rules. CSS is not created for display, but is applied to a variety of media, such as the common display, the more and more handheld devices, may be slightly outdated TV sets and so on.

The introduction of Media Queries is designed to allow the addition of an expression to determine the media situation in order to apply a different style sheet. In other words, it allows us to enhance the experience by changing the layout of the page to fit the different devices without changing the content. So media queries and CSS optimization are not related, even contradictory.

Referencing the intuitive DEMO in CSS3 Media queries, the applied CSS changes when the browser width changes. And these, originally need JavaScript control to do.

The trend towards web mobility is increasingly evident. Although the country is subject to a lot of restrictions, but this wave can not be stopped. A few days ago, jquery announced the mobile project, which also accelerated the change. Media Queries should be used more in the near future to better support emerging devices like the ipad. In fact, JQuery even has Media queries Plug-ins.

See what Media Queries did.

  

A three-column layout that, when the screen narrows, becomes a 1-column layout, or even a 2nd column that eliminates the extra two columns and leaves the usual content. How does Media queries work? First look at the link tag:

Code:

  

In Media properties:

Screen is one of the media types, and CSS2.1 defines 10 types of media

and is called a keyword, and other keywords include not (excluding some device), only (qualifying some device)

(min-width:400px) is the media feature, which is placed in a pair of parentheses. Complete features refer to the relevant Media features section

[1] [2] [3] Next page



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.