Results: Exact: Elapsed time: 66 ms. All rights reserved.
|Published (Last):||25 March 2013|
|PDF File Size:||17.53 Mb|
|ePub File Size:||15.46 Mb|
|Price:||Free* [*Free Regsitration Required]|
The and keyword is used for combining multiple media features together, as well as combining media features with media types. A basic media query, a single media feature with the implied all media type, could look like this:. If, however, you wanted this to apply only if the display is in landscape, you could use an and operator to chain the media features together.
Now the above media query will only return true if the viewport is px wide or wider and the display is in landscape. If, however, you only wanted this to apply if the display in question was of the media type TV, you could chain these features with a media type using an and operator. Now, the above media query will only apply if the media type is TV, the viewport is px wide or wider, and the display is in landscape.
When using a comma-separated list of media queries, if any of the media queries returns true, the styles or style sheets get applied. Each media query in a comma-separated list is treated as an individual query, and any operator applied to one media query does not affect the others. This means the comma-separated media queries can target different media features, types, and states.
For instance, if you wanted to apply a set of styles if the viewing device either had a minimum width of px or was a handheld in landscape, you could write the following:. The not keyword applies to the whole media query and returns true if the media query would otherwise return false such as monochrome on a color display or a screen width of px with a min-width: px feature query. A not will only negate the media query it is applied to and not to every media query if present in a comma-separated list of media queries.
The not keyword cannot be used to negate an individual feature query, only an entire media query. Media queries are case insensitive. Media queries involving unknown media types are always false. If you use a media feature without specifying a value, the expression resolves to true if the feature's value is non-zero.
Indicates the number of bits per color component of the output device. If the device is not a color device, this value is zero. Describes the aspect ratio of the targeted display area of the output device. This represents the ratio of horizontal pixels first term to vertical pixels second term. The following selects a special style sheet to use for when the display area is at least as wide as it is high.
This selects the style when the aspect ratio is either or greater. In other words, these styles will only be applied when the viewing area is square or landscape. Describes the aspect ratio of the output device. Describes the height of the output device meaning the entire screen or page, rather than just the rendering area, such as the document window. To apply a style sheet to a document when displayed on a screen that is less than pixels long, you can use this:.
Describes the width of the output device meaning the entire screen or page, rather than just the rendering area, such as the document window. To apply a style sheet to a document when displayed on a screen that is less than pixels wide, you can use this:. Determines whether the output device is a grid device or a bitmap device.
If the device is grid-based such as a TTY terminal or a phone display with only one font , the value is 1. Otherwise it is zero. The height media feature describes the height of the output device's rendering surface such as the height of the viewport or of the page box on a printer.
If the device isn't monochrome, the device's value is 0. Indicates the resolution pixel density of the output device. The resolution may be specified in either dots per inch dpi or dots per centimeter dpcm. The width media feature describes the width of the rendering surface of the output device such as the width of the document window, or the width of the page box on a printer.
If you want to specify a style sheet for handheld devices, or screen devices with a width greater than 20em, you can use this query:. This query specifies a style sheet that is usable when the viewport is between and pixels wide:. Mozilla offers several Gecko-specific media features.
Some of these may be proposed as official media features. If the device allows images to appear in menus, this is 1; otherwise, the value is 0. This corresponds to the :-moz-system-metric mac-graphite-theme CSS pseudo-class. If the user is using Maemo with the original theme, this is 1; if it's using the newer Fremantle theme, this is 0. This corresponds to the :-moz-system-metric maemo-classic CSS pseudo-class.
Use the resolution feature with the dppx unit instead. Indicates which operating system version is currently being used. Possible values are:. This is provided for application skins and other chrome code to be able to adapt to work well with the current operating system version. If the device's user interface displays a backward arrow button at the end of scrollbars, this is 1. Otherwise it's 0. This corresponds to the :-moz-system-metric scrollbar-end-backward CSS pseudo-class.
If the device's user interface displays a forward arrow button at the end of scrollbars, this is 1. This corresponds to the :-moz-system-metric scrollbar-end-forward CSS pseudo-class. If the device's user interface displays a backward arrow button at the beginning of scrollbars, this is 1.
This corresponds to the :-moz-system-metric scrollbar-start-backward CSS pseudo-class. If the device's user interface displays a forward arrow button at the beginning of scrollbars, this is 1. This corresponds to the :-moz-system-metric scrollbar-start-forward CSS pseudo-class.
If the device's user interface displays the thumb of scrollbars proportionally that is, sized based on the percentage of the document that is visible , this is 1.
This corresponds to the :-moz-system-metric scrollbar-thumb-proportional CSS pseudo-class. This corresponds to the :-moz-system-metric touch-enabled CSS pseudo-class. You might use this to render your buttons slightly larger, for example, if the user is on a touch-screen device, to make them more finger-friendly. If the user is using Windows unthemed in classic mode instead of using uxtheme , this is 1; otherwise it's 0.
This corresponds to the :-moz-system-metric windows-classic CSS pseudo-class. This corresponds to the :-moz-system-metric windows-compositor CSS pseudo-class. This corresponds to the :-moz-system-metric windows-default-theme CSS pseudo-class.
If the user is using Windows Glass theme, this is 1; otherwise it's 0. Note that this only exists for Windows 7 and earlier. Indicates which Windows theme is currently being used. This is provided for application skins and other chrome code to be able to adapt to work well with the current Windows theme.
Get the latest and greatest from MDN delivered straight to your inbox. Note: Parentheses are required around expressions; failing to use them is an error. Note: If a media feature doesn't apply to the device on which the browser is running, expressions involving that media feature are always false. For example, querying the aspect ratio of an aural device always results in false. Note: If the color components have different numbers of bits per color component, the smallest number is used.
For example, if a display uses 5 bits for blue and red and 6 bits for green, then the device is considered to use 5 bits per color component. If the device uses indexed colors, the minimum number of bits per color component in the color table is used.
Note: As the user resizes the window, Firefox switches style sheets as appropriate based on media queries using the width and height media features. Note: This value does not correspond to actual device orientation. Opening the soft keyboard on most devices in portrait orientation will cause the viewport to become wider than it is tall, thereby causing the browser to use landscape styles instead of portrait.
Do not use this feature. The min and max prefixes as implemented by Gecko are named min--moz-device-pixel-ratio and max--moz-device-pixel-ratio ; but the same prefixes as implemented by Webkit are named -webkit-min-device-pixel-ratio and -webkit-max-device-pixel-ratio.
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains.
Find out how you can help! Pulpit Mobile. Yes Yes. Ostatnia modyfikacja: Jun 3, , autorzy MDN. Poznaj najlepsze metody tworzenia stron Get the latest and greatest from MDN delivered straight to your inbox.
All web browsers have a built-in style sheet that defines the default styling for all elements. When a page author defines their own styles, they can override this built-in style sheet and tell the browser to display elements in a different way. Styles defined in an external style sheet usually a. And element styles applied directly to an element override internal styles.
Using media queries
Learn from over examples! With our editor, you can edit the CSS, and click on a button to view the result. At W3Schools you will find complete CSS references of all properties and selectors with syntax, examples, browser support, and more. The Bootstrap Certificate documents your knowledge of the Bootstrap framework. If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:.
The waterfall model is a breakdown of project activities into linear sequential phases, where each phase depends on the deliverables of the previous one and corresponds to a specialisation of tasks. The approach is typical for certain areas of engineering design. In software development , it tends to be among the less iterative and flexible approaches, as progress flows in largely one direction "downwards" like a waterfall through the phases of conception, initiation, analysis , design , construction , testing , deployment and maintenance. The waterfall development model originated in the manufacturing and construction industries; where the highly structured physical environments meant that design changes became prohibitively expensive much sooner in the development process.