Promptles
Frontend & Responsive Design

Media Query

beginner

Definition

A way to tell a webpage 'apply these styles only when the screen looks like this.' It's how the same site can show one layout on a phone, another on a tablet, and another on a desktop: without needing to be three separate websites.

In the wild

A blog uses a media query that says 'on screens narrower than a tablet, hide the sidebar and let the article take up the full width.' On a desktop the sidebar is visible; on a phone it quietly disappears so the writing stays comfortable to read.

More from Frontend & Responsive Design