Media queries

The first two foundations of responsive web design can only get you so far. The most important foundation is the media query. Media queries are basically "if" statements or conditional logic inside your CSS. For instance, if the width of the browser is less than 500 pixels, we can then apply different rule sets based on these conditions. Media queries are extremely powerful because at certain points, our website really breaks down and looks bad, and we're going to need to fix this with . In this section, we'll figure out what a media query is, and we'll use it to fix the remaining issues with the site, especially at narrower widths.

Another thing to consider is this – since we're going to shrink our browser window to kind of ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.