Advertisement
fahimmurshed

CSS Media Query Cheat Sheet (with Foundation)

Sep 25th, 2023
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 3.12 KB | None | 0 0
  1. /*------------------------------------------
  2.   Responsive Grid Media Queries - 1280, 1024, 768, 480
  3.    1280-1024   - desktop (default grid)
  4.    1024-768    - tablet landscape
  5.    768-480     - tablet
  6.    480-less    - phone landscape & smaller
  7. --------------------------------------------*/
  8. @media all and (min-width: 1024px) and (max-width: 1280px) { }
  9.  
  10. @media all and (min-width: 768px) and (max-width: 1024px) { }
  11.  
  12. @media all and (min-width: 480px) and (max-width: 768px) { }
  13.  
  14. @media all and (max-width: 480px) { }
  15.  
  16. /*------------------------------------------
  17.   Foundation Media Queries
  18.    http://foundation.zurb.com/docs/media-queries.html
  19. --------------------------------------------*/
  20.  
  21. /* Small screens - MOBILE */
  22. @media only screen { } /* Define mobile styles - Mobile First */
  23.  
  24. @media only screen and (max-width: 40em) { } /* max-width 640px, mobile-only styles, use when QAing mobile issues */
  25.  
  26. /* Medium screens - TABLET */
  27. @media only screen and (min-width: 40.063em) { } /* min-width 641px, medium screens */
  28.  
  29. @media only screen and (min-width: 40.063em) and (max-width: 64em) { } /* min-width 641px and max-width 1024px, use when QAing tablet-only issues */
  30.  
  31. /* Large screens - DESKTOP */
  32. @media only screen and (min-width: 64.063em) { } /* min-width 1025px, large screens */
  33.  
  34. @media only screen and (min-width: 64.063em) and (max-width: 90em) { } /* min-width 1024px and max-width 1440px, use when QAing large screen-only issues */
  35.  
  36. /* XLarge screens */
  37. @media only screen and (min-width: 90.063em) { } /* min-width 1441px, xlarge screens */
  38.  
  39. @media only screen and (min-width: 90.063em) and (max-width: 120em) { } /* min-width 1441px and max-width 1920px, use when QAing xlarge screen-only issues */
  40.  
  41. /* XXLarge screens */
  42. @media only screen and (min-width: 120.063em) { } /* min-width 1921px, xlarge screens */
  43.  
  44. /*------------------------------------------*/
  45.  
  46.  
  47.  
  48. /* Portrait */
  49. @media screen and (orientation:portrait) { /* Portrait styles here */ }
  50. /* Landscape */
  51. @media screen and (orientation:landscape) { /* Landscape styles here */ }
  52.  
  53.  
  54. /* CSS for iPhone, iPad, and Retina Displays */
  55.  
  56. /* Non-Retina */
  57. @media screen and (-webkit-max-device-pixel-ratio: 1) {
  58. }
  59.  
  60. /* Retina */
  61. @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
  62. only screen and (-o-min-device-pixel-ratio: 3/2),
  63. only screen and (min--moz-device-pixel-ratio: 1.5),
  64. only screen and (min-device-pixel-ratio: 1.5) {
  65. }
  66.  
  67. /* iPhone Portrait */
  68. @media screen and (max-device-width: 480px) and (orientation:portrait) {
  69. }
  70.  
  71. /* iPhone Landscape */
  72. @media screen and (max-device-width: 480px) and (orientation:landscape) {
  73. }
  74.  
  75. /* iPad Portrait */
  76. @media screen and (min-device-width: 481px) and (orientation:portrait) {
  77. }
  78.  
  79. /* iPad Landscape */
  80. @media screen and (min-device-width: 481px) and (orientation:landscape) {
  81. }
  82.  
  83. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  84.  
  85.  
  86. /*------------------------------------------
  87.   Live demo samples
  88.    - http://andrelion.github.io/mediaquery/livedemo.html
  89. --------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement