Media Queries: General Guidelines

Using media queries is a great way to optimize your sites for all different mobile viewports. When using media queries to make your site responsive and mobile friendly, it’s important to keep certain breaking points in mind. Use the media queries in this snippet to make sure that your CSS is optimized specifically to accommodate the most popular devices/viewport sizes.

  1. /* Desktops and laptops */
  2. @media only screen and (min-width : 1224px) {
  3.  
  4. }
  5.  
  6. /* Large screens */
  7. @media only screen and (min-width : 1824px) {
  8.  
  9. }
  10.  
  11. /* Tablets (landscape) */
  12. @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
  13.  
  14. }
  15.  
  16. /* Tablets (portrait) */
  17. @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
  18.  
  19. }
  20.  
  21. /* Smartphones (landscape) */
  22. @media only screen and (min-width : 321px) {
  23.  
  24. }
  25.  
  26. /* Smartphones (portrait) */
  27. @media only screen and (max-width : 320px) {
  28.  
  29. }

Share and Enjoy !

0Shares
0 0