媒体查询(用于响应式网页设计)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了媒体查询(用于响应式网页设计)相关的知识,希望对你有一定的参考价值。

A couple of useful media queries...
  1. /* iPad portrait */
  2. @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)
  3.  
  4. /* iPad landscape */
  5. @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape)
  6.  
  7. /* iPhone portrait */
  8. @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (orientation: portrait)
  9.  
  10. /* iPhone landscape */
  11. @media only screen and (min-device-width: 320px) and (max-device-width: 480px) and (orientation: landscape)
  12.  
  13. /**
  14.   * other example
  15.   */
  16.  
  17. /* Mobile only */
  18. @media screen and (max-width: 623px)
  19.  
  20. /* For Tablet and Desktop */
  21. @media screen and (min-width: 624px)
  22.  
  23. /* Desktop */
  24. @media screen and (min-width: 948px)

以上是关于媒体查询(用于响应式网页设计)的主要内容,如果未能解决你的问题,请参考以下文章

网页响应式媒体查询代码

响应式网页设计媒体查询宽度不变

响应式WEB&媒体查询

CSS 媒体查询最近不适用于 iPad

响应式网页之媒体查询

css 响应式网页设计 - 媒体查询