CSS Media Queries reference documentation cards
CSS Media Queries
A complete reference β responsive breakpoints, device types, orientation, and pixel density.
Responsive grid breakpoints
Desktop (default)
1280px and above
@media all and (min-width: 1280px) { }
Large tablet
1024px β 1280px
@media all and
(min-width: 1024px) and
(max-width: 1280px) { }
Tablet landscape
768px β 1024px
@media all and
(min-width: 768px) and
(max-width: 1024px) { }
Tablet portrait
480px β 768px
@media all and
(min-width: 480px) and
(max-width: 768px) { }
Phone
480px and below
@media all and
(max-width: 480px) { }
Foundation breakpoints (mobile-first)
Mobile
All screens β base styles
@media only screen { }
@media only screen and
(max-width: 40em) { }
Tablet
641px β 1024px
@media only screen and
(min-width: 40.063em) { }
@media only screen and
(min-width: 40.063em) and
(max-width: 64em) { }
Desktop
1025px β 1440px
@media only screen and
(min-width: 64.063em) { }
@media only screen and
(min-width: 64.063em) and
(max-width: 90em) { }
XLarge
1441px β 1920px
@media only screen and
(min-width: 90.063em) { }
@media only screen and
(min-width: 90.063em) and
(max-width: 120em) { }
XXLarge
1921px and above
@media only screen and
(min-width: 120.063em) { }
Orientation
Portrait
Height > width
@media screen and
(orientation: portrait) { }
Applies when the device is held vertically.
Landscape
Width > height
@media screen and
(orientation: landscape) { }
Applies when the device is held horizontally.
Pixel density (retina)
Standard display
1Γ pixel density
@media screen and
(-webkit-max-device-pixel-ratio: 1) { }
Retina / HiDPI
1.5Γ and above
@media only screen and
(-webkit-min-device-pixel-ratio: 1.5),
only screen and
(min-device-pixel-ratio: 1.5) { }
Device-specific (iOS)
iPhone portrait
max-width 480px + portrait
@media screen and
(max-device-width: 480px) and
(orientation: portrait) { }
iPhone landscape
max-width 480px + landscape
@media screen and
(max-device-width: 480px) and
(orientation: landscape) { }
iPad portrait
min-width 481px + portrait
@media screen and
(min-device-width: 481px) and
(orientation: portrait) { }
iPad landscape
min-width 481px + landscape
@media screen and
(min-device-width: 481px) and
(orientation: landscape) { }
Viewport meta tag
Required in <head>
Prevents mobile browsers from zooming out to fit desktop layout
<meta name="viewport"
content="width=device-width,
initial-scale=1,
maximum-scale=1,
user-scalable=no" />
Note: setting user-scalable=no disables pinch-to-zoom β consider accessibility before using it.