Media query in CSS3_html/css_WEB-ITnose
Jun 24, 2016 am 11:47 AM
In the past few days, I have been reading CSS3 on MOOC.com, which is very detailed.
The address is here: http://www.imooc.com/code/1405
Take notes:
1. Media query in css3
1. In CSS3 10 media query types
value Device type
all All devices (requires familiarity)
screen Screen display (needs familiarity)
print Print paper or print preview view (requires Familiar)
braille Braille tactile feedback device for the blind
embossed Braille printer
handheld Portable device
projection Various projection devices
speech Speech or audio synthesizer
tv TV type Device
tty Media that uses a fixed density letter grid, such as teletypewriters and terminals
2. Reference methods for common 3-fold media types
① link method
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
@importurl(reset.css) screen;
③ @media method
<style type="text/css"> @media screen{ 选择器{/*你的样式代码写在这里…*/}}</style>
3 . How to use media queries
@media media type and (media properties) {your style}
Media type: the 10 mentioned above
Media properties: max-width:400px Maximum width
🎜>
②Exclude a certain device
/*用and连接*/@media screen and (min-width:600px) and (max-width:900px){ body {background-color:#f5f5f5;}}
2. Response Layout skills in style design
/*用not*/@media not print and (max-width: 1200px){ 样式代码}/*上面代码表示的是:样式代码将被使用在除打印设备和设备宽度小于1200px下所有设备中。*/
First, try to use as few irrelevant divs as possible;
Second, don’t use inline elements (inline);
/*用only*/<linkrel="stylesheet" media="only screen and (max-device-width:240px)" href="android240.css" />
Fourth, discard useless absolute positioning and floating styles;
Fifth, abandon any redundant structures and do not use 100% settings.
Sixth, try to use H5 meaningful tags
What kind of layout or HTML structure is simple and clean
? Here I will teach you a quick test method.
You first disable all styles in your page (and information related to styles
) and open it in the browser. If your content
is arranged in an orderly manner and is easy to read, then your The structure
won’t be any worse.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input?

What is the purpose of the <iframe> tag? What are the security considerations when using it?

How to efficiently add stroke effects to PNG images on web pages?

What is the purpose of the <meter> element?

What is the purpose of the <datalist> element?

What is the viewport meta tag? Why is it important for responsive design?

What is the purpose of the <progress> element?
