Media query in CSS3, CSS3media

Source: Internet
Author: User

Media query in CSS3, CSS3media

In the past few days, I have read in detail the CSS3 of MOOC,
Address here: http://www.imooc.com/code/1405


Take notes:
1. media query in css3 1. 10 media query types in CSS3 value device types
All devices (familiar)
Screen Display (familiar)
Print paper or print preview view (familiar)
Braille tactile feedback device for blind people
Embossed Braille printer
Handheld portable device
Projection various projection Devices
Speech or audio Synthesizer
TV Devices
Tty uses fixed-density letter raster media, such as telex typewriters and Terminals

2. Common reference methods for three media types ① link Method
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />

② @ Import Method
@importurl(reset.css) screen;   

③ @ Media Method
<Style type = "text/css"> @ media screen {selector {/* write your style code here... * // }}</Style>

3. How to use media query @ media type and (media features) {your style}


Media type: the 10 types mentioned above
Media features: max-width: 400px maximum width
Min-width: 400px min width
...

① Use of multiple media features
/* Connect with and */@ media screen and (min-width: 600px) and (max-width: 900px) {body {background-color: # f5f5f5 ;}}

② Exclude a device
/* Use not */@ media not print and (max-width: pixel px) {style code}/* The code above indicates: the style code is used on all devices except printing devices and devices whose width is less than pixel PX. */

③ Only used on a device
/* Use only */<linkrel = "stylesheet" media = "only screen and (max-device-width: 240px)" href = "android240.css"/>

2. layout skills in responsive Design 1. Use as few irrelevant div as possible;
Second, do not use inline elements (inline );
Third, use JS or flash as little as possible;
Fourth, discard useless absolute positioning and floating styles;
Fifth, discard any redundant structure and do not use the 100% setting.
Sixth, try to use H5 meaningful labels


The layout or HTML structure is simple and clean.
? Here is a quick test method.
You first disable all styles on your page (and
In the browser, if your
This structure is organized and easy to read.
It will not make any difference.


















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.