;}}
The notation is preceded by a @media, and the other is the same as the media attribute in link.Max WidthThe following styles are applied when the width of the viewable area is less than 600px.
123456
@media screen and (max-width: 600px) {.class {background: #fff;你的样式}}
Min WidthThe following styles are applied when t
Your Web page will look good on your phone. The mystery of completing this task is called responsive Design, and media query is the key to implementing a Web page response.On the computer an example:Divclass= "Row"> Divclass= "Span4">...Div> Divclass= "Span4">...Div> Divclass= "Span4">...Div>Div>CSS style:. Row { width:100%;} . Span { width:300px; float:left; margin-left:30px;}This is disp
Today's screen resolution is as small as 320px (iPhone), as large as 2560px or even higher (large display), and the change range is extremely large. In addition to traditional desktops, more and more users will browse the pages through tablet devices such as mobile phones, netbooks, and iPad. In this case, the fixed-width design scheme will become increasingly unreasonable. The page must have better adaptability, and its layout structure should be adjusted according to different devices and scre
Start to study responsive web design. css3 media queries is an entry.
Media queries allows you to add expressions to determine the media environment and apply different style sheets. In other words, it allows us to change the page layout without changing the content to precisely adapt to different devices.
How does
Today's screen resolution, as small as 320px (IPhone), large to 2560px or even higher (large display), the range is great. In addition to the use of traditional desktops, users will increasingly be on mobile phones, netbooks, ipad-type tablet devices to browse the page. In this case, the fixed width of the design will appear more unreasonable. The page needs to be more adaptable, and its layout structure should be adjusted to respond to different devices and screen resolutions. Next, we'll look
when the width of the viewable area is greater than 900px.
12345
@mediascreenand (min-width:900px) {.class {background:#666;}}
Multiple Media QueriesYou can also use a match condition where the following style is applied when the width of the viewable area is between 600px and 900px.
12345
@mediascreenand (min-width:600px) and (max-width:900px) {.class {background:#333;}}
Device WidthThe
Media queries can set CSS styles based on device display characteristics . Media query Syntax:1, written in the style:@media conditions@media screen and (max-width:550px) {/* style * /}2, written in the link tagrel= "stylesheet" media= "screen and (max-width:550px)" href =
Concept:Device-pixel-ratio: Defines the ratio of the visual width to the visible height of the input device screen.Device-width: Enter the visual width of the device screen.Orientation: The screen is oriented vertically. Landscape is horizontal, Portrait is Portrait "ipad opposite"/* IPhone 4 ——— –*/@mediaOnly screen and (-webkit-min-device-pixel-ratio:1.5),Only screen and (min-device-pixel-ratio:1.5) {/*styles*/}/* IPads (Portrait) ——— –*/@media only
This article mainly for you in detail the CSS3 media queries with jquery to achieve responsive navigation, with a certain reference value, interested in small partners can refer to
Objective:
Implement a responsive navigation, when the screen width is greater than 700px, the effect is as follows:
When the screen width is less than 700px, the navigation becomes
have a pattern like this:So it's all slidetoggle, he is. By setting the element's inline style to hide the element, this method sets the priority of the style to be the highest in three ways, so the block set in the CSS is no use at all.To solve this problem, you can use JS, or you can use a higher priority way:!important.If you choose to use!important, you need to set the navigation list is hidden by default, or he will never hide.The final CSS code is as follows:. Nav{Display:None;position:Ab
CSS3 media queries integrates jQuery to implement responsive navigation. css3jquery
Purpose:
Implement a responsive navigation. When the screen width is greater than 700px, the effect is as follows:
When the screen width is less than 700px, the navigation becomes a small button, and a menu is clicked to pull down slowly:
Ideas:
1. To bind events to the menu lat
-webkit-min-device-pixel-ratio is 2.0
IPhone 4
IPhone 4S
IPhone 5
IPad (3rd generation)
IPad 4
All Retina displays for Mac
Google Galaxy Nexus
Google Nexus 4
Google Nexus 10
Samsung Galaxy S III
Samsung Galaxy Note II
Sony Xperia S
HTC One X
-webkit-min-device-pixel-ratio:3.01.HTC Butterfly2.Sony Xperia S(MIN-RESOLUTION:144DPI)
Used in: Bitmap media type,
Why do responsive designs require media queries?The media features available for detection in media queries are width, height, and color (and so on). With media queries, you can customize the display for certain output devices without changing the content of the page.To use
In CSS2, you can specify a dedicated style sheet for different media devices, such as screens, printers, and now with CSS3 's media Queries feature, you can do this more efficiently. You can add certain conditions to the media type, detect the device, and adopt a different style sheet.For example, you can put styles for display on large screens and special styles
things right.that films like King Kong, Moulin Rouge and Munich get the statue whilst the real cinematic Heroes lose out. Not very Hollywood is it? We ' re here to put things right.P> Div> DivID= "sidebar"> P>The sidebarP> Div> DivID= "Footer"> P>The footerP> Div>Div>Body>*{padding:0;margin:0;}#wrapper{Margin-right:Auto;Margin-left:Auto;width:960px;Border:1px solid Red;}#header{Margin-right:10px;Margin-left:10px;width:940px;Background-image:URL (images/bunti
Media query, which is an indispensable part of the responsive layout, is the medium.Media query in CSS3 has added a lot of press queries so that in CSS3 we can adjust the page layout to accommodate different devices by adding various expressions to set different types of media conditions without changing the page expression content.Media query is set up in two wa
Today's screen resolution, as small as 320px (IPhone), large to 2560px or even higher (large display), the range is great. In addition to the use of traditional desktops, users will be more and more throughMobile Phone, netbooks, ipad-type tablet devices to browse the page. In this case, the fixed width of the design will appear more unreasonable. The page needs to be more adaptable, and its layout structure should be adjusted to respond to different devices and screen resolutions. NextI'mWe wil
file must be placed in the back of the CSS file 4, in addition, although the respond placed in the head or behind the body can be achieved , but is recommended to be placed in the head (for specific reasons mentioned in the following document hint) 5, it is best not to set the Utf-8 encoding for CSS, use the default (for reasons described in the following Document Tips section)Documentation TipsSome tips in the official documentation: 1, the earlier the introduction of respond.js files, the mor
Chania
The Flight
The city
The island
The food
The cityChania is the capital of the Chania region on the island of Crete. The city can is divided in the parts of the old town and the modern city.What?Chania is a city on the island of Crete.Where?Crete is a Greek island in the Mediterranean Sea.How?You can reach Chania Airport from any over Europe.Resize the browser window to see how the content respond to the resizing.CSS3 Responsiv
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.