{"id":7667,"date":"2010-10-08T11:07:06","date_gmt":"2010-10-08T18:07:06","guid":{"rendered":"http:\/\/css-tricks.com\/"},"modified":"2022-09-30T10:40:35","modified_gmt":"2022-09-30T17:40:35","slug":"media-queries-for-standard-devices","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/snippets\/css\/media-queries-for-standard-devices\/","title":{"rendered":"Media Queries for Standard Devices"},"content":{"rendered":"\n

If you think responsive’s simple, I feel bad for you son. We got 99 viewports, but the iPhone’s just one.
\u2014Josh Brewer, March 10, 2010<\/a><\/p><\/blockquote>\n\n\n\n

A major component of responsive design is creating the right experience for the right device. With a gazillion different devices on the market, this can be a tall task. We’ve rounded up media queries that can be used to target designs for many standard and popular devices that is certainly worth a read.<\/p>\n\n\n\n

If you’re looking for a comprehensive list of media queries, this repository<\/a> is a good resource.<\/p>\n\n\n\n

If you’re reaction to this is: you should never base your breakpoints on devices!!<\/em> You have a good point. Justin Avery has a nice post<\/a> on the possible pitfalls of using device-specific breakpoints. Choosing breakpoints based on your design and not specific devices is a smart way to go. But sometimes you just need a little help getting one particular situation under control.<\/p>\n\n\n\n

\n \n

Phones and handhelds<\/h3>\n <\/summary>\n \n\n
\n \n iPhone <\/summary>\n \n\n
\/* ----------- iPhone 4 and 4S ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 320px) \n  and (max-device-width: 480px)\n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 320px) \n  and (max-device-width: 480px)\n  and (-webkit-min-device-pixel-ratio: 2)\n  and (orientation: portrait) {\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 320px) \n  and (max-device-width: 480px)\n  and (-webkit-min-device-pixel-ratio: 2)\n  and (orientation: landscape) {\n\n}\n\n\/* ----------- iPhone 5, 5S, 5C and 5SE ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 320px) \n  and (max-device-width: 568px)\n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 320px) \n  and (max-device-width: 568px)\n  and (-webkit-min-device-pixel-ratio: 2)\n  and (orientation: portrait) {\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 320px) \n  and (max-device-width: 568px)\n  and (-webkit-min-device-pixel-ratio: 2)\n  and (orientation: landscape) {\n\n}\n\n\/* ----------- iPhone 6, 6S, 7 and 8 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 375px) \n  and (max-device-width: 667px) \n  and (-webkit-min-device-pixel-ratio: 2) { \n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 375px) \n  and (max-device-width: 667px) \n  and (-webkit-min-device-pixel-ratio: 2)\n  and (orientation: portrait) { \n\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 375px) \n  and (max-device-width: 667px) \n  and (-webkit-min-device-pixel-ratio: 2)\n  and (orientation: landscape) { \n\n}\n\n\/* ----------- iPhone 6+, 7+ and 8+ ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 414px) \n  and (max-device-width: 736px) \n  and (-webkit-min-device-pixel-ratio: 3) { \n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 414px) \n  and (max-device-width: 736px) \n  and (-webkit-min-device-pixel-ratio: 3)\n  and (orientation: portrait) { \n\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 414px) \n  and (max-device-width: 736px) \n  and (-webkit-min-device-pixel-ratio: 3)\n  and (orientation: landscape) { \n\n}\n\n\/* ----------- iPhone X ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 375px) \n  and (max-device-width: 812px) \n  and (-webkit-min-device-pixel-ratio: 3) { \n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 375px) \n  and (max-device-width: 812px) \n  and (-webkit-min-device-pixel-ratio: 3)\n  and (orientation: portrait) { \n\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 375px) \n  and (max-device-width: 812px) \n  and (-webkit-min-device-pixel-ratio: 3)\n  and (orientation: landscape) { \n\n}<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n<\/details>\n\n\n

\n \n Galaxy Phones <\/summary>\n \n\n
\/* ----------- Galaxy S3 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 320px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 2) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 320px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 2) \n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Galaxy S4, S5 and Note 3 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 320px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 320px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 320px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) \n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Galaxy S6 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 4) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 4) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 4) \n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n<\/details>\n\n\n

\n \n HTC Phones <\/summary>\n \n\n
\/* ----------- HTC One ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) \n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n<\/details>\n\n\n

\n \n Google Pixel <\/summary>\n \n\n
\/* ----------- Google Pixel ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 3) \n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Google Pixel XL ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 4) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 4) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 640px) \n  and (-webkit-device-pixel-ratio: 4) \n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n<\/details>\n\n\n

\n \n Nexus Phones <\/summary>\n \n\n
\/* ----------- Nexus 4 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 384px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 384px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 2)\n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 384px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 2)\n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Nexus 5 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 3) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 3)\n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 3)\n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Nexus 6 and 6P ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 4) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 4)\n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 360px) \n  and (device-height: 592px) \n  and (-webkit-device-pixel-ratio: 4)\n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n<\/details>\n\n\n

\n \n Windows Phone <\/summary>\n \n\n
\/* ----------- Windows Phone ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 480px) \n  and (device-height: 800px) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 480px) \n  and (device-height: 800px)  \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 480px) \n  and (device-height: 800px) \n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n<\/details>\n\n<\/details>\n\n\n
\n \n

Laptops<\/h3>\n <\/summary>\n \n\n

Media Queries for laptops are a bit of a juggernaut. Instead of targeting specific devices, try specifying a general screen size range, then distinguishing between retina and non-retina screens.<\/p>\n\n\n\n

\/* ----------- Non-Retina Screens ----------- *\/\n@media screen \n  and (min-device-width: 1200px) \n  and (max-device-width: 1600px) \n  and (-webkit-min-device-pixel-ratio: 1) { \n}\n\n\/* ----------- Retina Screens ----------- *\/\n@media screen \n  and (min-device-width: 1200px) \n  and (max-device-width: 1600px) \n  and (-webkit-min-device-pixel-ratio: 2)\n  and (min-resolution: 192dpi) { \n}<\/code><\/pre>\n\n\n<\/details>\n\n\n
\n \n

Tablets<\/h3>\n <\/summary>\n \n\n
\n \n iPad <\/summary>\n \n\n
\/* ----------- iPad 1, 2, Mini and Air ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 768px) \n  and (max-device-width: 1024px) \n  and (-webkit-min-device-pixel-ratio: 1) {\n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 768px) \n  and (max-device-width: 1024px) \n  and (orientation: portrait) \n  and (-webkit-min-device-pixel-ratio: 1) {\n\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 768px) \n  and (max-device-width: 1024px) \n  and (orientation: landscape) \n  and (-webkit-min-device-pixel-ratio: 1) {\n\n}\n\n\/* ----------- iPad 3, 4 and Pro 9.7\" ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 768px) \n  and (max-device-width: 1024px) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 768px) \n  and (max-device-width: 1024px) \n  and (orientation: portrait) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 768px) \n  and (max-device-width: 1024px) \n  and (orientation: landscape) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* ----------- iPad Pro 10.5\" ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 834px) \n  and (max-device-width: 1112px)\n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n\/* Declare the same value for min- and max-width to avoid colliding with desktops *\/\n\/* Source: https:\/\/medium.com\/connect-the-dots\/css-media-queries-for-ipad-pro-8cad10e17106*\/\n@media only screen \n  and (min-device-width: 834px) \n  and (max-device-width: 834px) \n  and (orientation: portrait) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Landscape *\/\n\/* Declare the same value for min- and max-width to avoid colliding with desktops *\/\n\/* Source: https:\/\/medium.com\/connect-the-dots\/css-media-queries-for-ipad-pro-8cad10e17106*\/\n@media only screen \n  and (min-device-width: 1112px) \n  and (max-device-width: 1112px) \n  and (orientation: landscape) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* ----------- iPad Pro 12.9\" ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 1024px) \n  and (max-device-width: 1366px)\n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n\/* Declare the same value for min- and max-width to avoid colliding with desktops *\/\n\/* Source: https:\/\/medium.com\/connect-the-dots\/css-media-queries-for-ipad-pro-8cad10e17106*\/\n@media only screen \n  and (min-device-width: 1024px) \n  and (max-device-width: 1024px) \n  and (orientation: portrait) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Landscape *\/\n\/* Declare the same value for min- and max-width to avoid colliding with desktops *\/\n\/* Source: https:\/\/medium.com\/connect-the-dots\/css-media-queries-for-ipad-pro-8cad10e17106*\/\n@media only screen \n  and (min-device-width: 1366px) \n  and (max-device-width: 1366px) \n  and (orientation: landscape) \n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}<\/code><\/pre>\n\n\n\n

<\/p>\n\n\n\n

<\/p>\n\n\n<\/details>\n\n\n

\n \n Galaxy Tablets <\/summary>\n \n\n
\/* ----------- Galaxy Tab 2 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media \n  (min-device-width: 800px) \n  and (max-device-width: 1280px) {\n\n}\n\n\/* Portrait *\/\n@media \n  (max-device-width: 800px) \n  and (orientation: portrait) { \n\n}\n\n\/* Landscape *\/\n@media \n  (max-device-width: 1280px) \n  and (orientation: landscape) { \n\n}\n\n\/* ----------- Galaxy Tab S ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media \n  (min-device-width: 800px) \n  and (max-device-width: 1280px)\n  and (-webkit-min-device-pixel-ratio: 2) {\n\n}\n\n\/* Portrait *\/\n@media \n  (max-device-width: 800px) \n  and (orientation: portrait)\n  and (-webkit-min-device-pixel-ratio: 2) { \n\n}\n\n\/* Landscape *\/\n@media \n  (max-device-width: 1280px) \n  and (orientation: landscape)\n  and (-webkit-min-device-pixel-ratio: 2) { \n\n}<\/code><\/pre>\n\n\n<\/details>\n\n\n
\n \n Nexus Tablets <\/summary>\n \n\n
\/* ----------- Nexus 7 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 601px) \n  and (device-height: 906px) \n  and (-webkit-min-device-pixel-ratio: 1.331) \n  and (-webkit-max-device-pixel-ratio: 1.332) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 601px) \n  and (device-height: 906px) \n  and (-webkit-min-device-pixel-ratio: 1.331) \n  and (-webkit-max-device-pixel-ratio: 1.332) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 601px) \n  and (device-height: 906px) \n  and (-webkit-min-device-pixel-ratio: 1.331) \n  and (-webkit-max-device-pixel-ratio: 1.332) \n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Nexus 9 ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media screen \n  and (device-width: 1536px) \n  and (device-height: 2048px) \n  and (-webkit-min-device-pixel-ratio: 1.331) \n  and (-webkit-max-device-pixel-ratio: 1.332) {\n\n}\n\n\/* Portrait *\/\n@media screen \n  and (device-width: 1536px) \n  and (device-height: 2048px) \n  and (-webkit-min-device-pixel-ratio: 1.331) \n  and (-webkit-max-device-pixel-ratio: 1.332) \n  and (orientation: portrait) {\n\n}\n\n\/* Landscape *\/\n@media screen \n  and (device-width: 1536px) \n  and (device-height: 2048px) \n  and (-webkit-min-device-pixel-ratio: 1.331) \n  and (-webkit-max-device-pixel-ratio: 1.332) \n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n<\/details>\n\n\n
\n \n Kindle Fire <\/summary>\n \n\n
\/* ----------- Kindle Fire HD 7\" ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 800px) \n  and (max-device-width: 1280px) \n  and (-webkit-min-device-pixel-ratio: 1.5) {\n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 800px) \n  and (max-device-width: 1280px) \n  and (-webkit-min-device-pixel-ratio: 1.5) \n  and (orientation: portrait) {\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 800px) \n  and (max-device-width: 1280px) \n  and (-webkit-min-device-pixel-ratio: 1.5) \n  and (orientation: landscape) {\n\n}\n\n\/* ----------- Kindle Fire HD 8.9\" ----------- *\/\n\n\/* Portrait and Landscape *\/\n@media only screen \n  and (min-device-width: 1200px) \n  and (max-device-width: 1600px) \n  and (-webkit-min-device-pixel-ratio: 1.5) {\n\n}\n\n\/* Portrait *\/\n@media only screen \n  and (min-device-width: 1200px) \n  and (max-device-width: 1600px) \n  and (-webkit-min-device-pixel-ratio: 1.5) \n  and (orientation: portrait) {\n}\n\n\/* Landscape *\/\n@media only screen \n  and (min-device-width: 1200px) \n  and (max-device-width: 1600px) \n  and (-webkit-min-device-pixel-ratio: 1.5) \n  and (orientation: landscape) {\n\n}<\/code><\/pre>\n\n\n<\/details>\n\n<\/details>\n\n\n
\n \n

Wearables<\/h3>\n <\/summary>\n \n\n
\/* ----------- Moto 360 Watch ----------- *\/\n@media \n  (max-device-width: 218px)\n  and (max-device-height: 281px) { \n\n}<\/code><\/pre>\n\n\n<\/details>\n\n\n
\n \n

More on media queries<\/h3>\n <\/summary>\n \n\n