I was wondering if someone can explain what each of the media queries in the example below mean in simple terms?
Here is the examples.
media="not screen and (color)"
media="projection, screen and (color)"
media="only projection and (color)"
HTML5 allows you to build offline applications. Browsers that support HTML5 offline applications (which is most) will download the HTML, CSS, JavaScript, images, and other resources that make up the application and cache them locally.
Hypertext Markup Language (HTML) is the primary language for developing web pages. HTML5 is a new version of HTML with new functionalities with markup language with Internet technologies. HTML does not have support for video and audio but, HTML5 supports both video and audio.
HTML5 is several years old now, and as the living standard of the language as a whole, it will only continue to get updated to work with the modern web.
The term HTML5 means not only HTML, it is a combination of HTML, CSS and Javascript with APIs . For example, drawing and animation using canvas, offline storage, microdata, audio and video, drag and drop, geolocation, embedded fonts, web APIs etc.
To analyze what media queries mean, you basically need to keep these things in mind:
So now in order.
Your first media query selects everything that's not a "screen and (color)". So it selects anything that's not a color screen (i.e. non-screens and also monochrome screens).
Your second media query selects anything that's a projection medium (whether color or monochrome) or a color screen.
Your third media query selects color projection media in UAs that implement media queries. In a UA that implements the HTML 4 algorithm, it's ignored because "only" is not an HTML 4 media specifier. If "only" were left out, then in old UAs it would select all projection media, because it would just extract that first word and ignore the "and (color)" part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With