@media
Widely availableSince 201597% of users
Applies styles only when certain conditions are met, such as specific screen widths, resolutions or user preferences like dark mode.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassic, with newer partsIt has worked everywhere since July 2015, and it keeps getting newer values.
Newer parts of @media
scripting media featureBaseline Dec 2023, Widely Jun 2026overflow-block media featureBaseline Sept 2023, Widely Mar 2026overflow-inline media featureBaseline Sept 2023, Widely Mar 2026update media featureBaseline Sept 2023, Widely Mar 2026or syntax from Media Queries Level 4Baseline Mar 2023, Widely Sept 2025Range syntax from Media Queries Level 4Baseline Mar 2023, Widely Sept 2025color-gamut media featureBaseline Feb 2023, Widely Aug 2025forced-colors media featureBaseline Sept 2022, Widely Mar 2025
See how modern your own CSS is.Check your CSS →
Quick example
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}@media browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
1+
1+
3+
12+Mobile
18+Android
4+Android
1+iOS