mbanna

CSS Media Queries

Sep 24th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. @media screen and (min-width:320px){} // mobile portrait
  2. @media screen and (min-width:480px){} // mobile landscape
  3. @media screen and (min-width:768px){} // ipad portrait
  4. @media screen and (min-width:1024px){} // browser, ipad landscape
  5. @media screen and (min-width:1200px){} // browser
  6. @media screen and (min-width:1600px){} // browser
  7.  
  8.  
  9. =============================================================
  10.  
  11. /* Smartphones (portrait and landscape) ----------- */
  12. @media only screen
  13. and (min-device-width : 320px)
  14. and (max-device-width : 480px) {
  15. /* Styles */
  16. }
  17.  
  18. /* Smartphones (landscape) ----------- */
  19. @media only screen
  20. and (min-width : 321px) {
  21. /* Styles */
  22. }
  23.  
  24. /* Smartphones (portrait) ----------- */
  25. @media only screen
  26. and (max-width : 320px) {
  27. /* Styles */
  28. }
  29.  
  30. /* iPads (portrait and landscape) ----------- */
  31. @media only screen
  32. and (min-device-width : 768px)
  33. and (max-device-width : 1024px) {
  34. /* Styles */
  35. }
  36.  
  37. /* iPads (landscape) ----------- */
  38. @media only screen
  39. and (min-device-width : 768px)
  40. and (max-device-width : 1024px)
  41. and (orientation : landscape) {
  42. /* Styles */
  43. }
  44.  
  45. /* iPads (portrait) ----------- */
  46. @media only screen
  47. and (min-device-width : 768px)
  48. and (max-device-width : 1024px)
  49. and (orientation : portrait) {
  50. /* Styles */
  51. }
  52.  
  53. /* Desktops and laptops ----------- */
  54. @media only screen
  55. and (min-width : 1224px) {
  56. /* Styles */
  57. }
  58.  
  59. /* Large screens ----------- */
  60. @media only screen
  61. and (min-width : 1824px) {
  62. /* Styles */
  63. }
  64.  
  65. /* iPhone 4 ----------- */
  66. @media
  67. only screen and (-webkit-min-device-pixel-ratio : 1.5),
  68. only screen and (min-device-pixel-ratio : 1.5) {
  69. /* Styles */
  70. }
Advertisement
Add Comment
Please, Sign In to add comment