From the course: CSS: Float-Based Page Layouts (2012)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using media queries

Using media queries - CSS Tutorial

From the course: CSS: Float-Based Page Layouts (2012)

Start my 1-month free trial

Using media queries

Media queries allow you to determine which styles are applied to pages based on specific media properties, such as screen width, color, or resolution. Now, if you're familiar with using the media attribute to apply styles for screen devices, print, projection, that sort of thing, then media queries are going to feel very natural to you, because they're just an extension of existing media capabilities. So to kind of show you what media queries are capable of, I have the media-queries.htm file open from the 07_02 folder. And I want to preview this page in the browser real quick, so we can do a quick rundown of the syntax before we actually start using them. So the basic syntax you can see in the first block of code here, basically after whatever media declaration you are doing, you can put before it, you can put two keywords, optional keywords: not or only. Not will negate everything that comes after it, so it's sort of testing to see what isn't true, and then only is designed basically…

Contents