{"id":319964,"date":"2020-10-02T08:13:37","date_gmt":"2020-10-02T15:13:37","guid":{"rendered":"https:\/\/css-tricks.com\/?p=319964"},"modified":"2024-05-01T10:35:07","modified_gmt":"2024-05-01T17:35:07","slug":"a-complete-guide-to-css-media-queries","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/a-complete-guide-to-css-media-queries\/","title":{"rendered":"A Complete Guide to CSS Media Queries"},"content":{"rendered":"\n
CSS Media queries are a way to target browser by certain characteristics, features, and user preferences, then apply styles or run other code based on those things. Perhaps the most common media queries in the world are those that target particular viewport ranges and apply custom styles, which birthed the whole idea of responsive design.<\/p>\n\n\n\n
\/* When the browser is at least 600px and above *\/\n@media screen and (min-width: 600px) {\n .element {\n \/* Apply some styles *\/\n }\n}<\/code><\/pre>\n\n\n\nThere are lots of other things we can target beside viewport width. That might be screen resolution, device orientation, operating system preference, or even more among a whole bevy of things we can query and use to style content.<\/p>\n\n\n\n