0
点赞
收藏
分享

微信扫一扫

媒体查询-手机尺寸参考

yeamy 04-17 12:45 阅读 2
  1. <meta charset="UTF-8" />  
  2.     <meta name="renderer" content="webkit" />  
  3.     <meta http-equiv="X-UA-Compatible" content="IE=EDGE, chrome=1">    
  4.     <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />  
  5.     <meta name="apple-mobile-web-app-capable" content="yes" />  
  6.     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />  
  7.     <meta name="msapplication-tap-highlight" content="no" />  
  8.     <meta name="format-detection" content="telephone=no" />    




  9. /@media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone5,因为5和4的屏幕宽度一样 */}  
  10. @media only screen and (max-device-width :480px){ }  
  11. @media only screen and (min-device-width :481px){ }  

  12. /*6*/  
  13. @media (min-device-width : 375px) and (max-device-width : 667px) and (-webkit-min-device-pixel-ratio : 2){ }  

  14. /*6+*/  
  15. @media (min-device-width : 414px) and (max-device-width : 736px) and (-webkit-min-device-pixel-ratio : 3){ }  

  16. /*魅族*/  
  17. @media only screen and (min-device-width :1080px) and (-webkit-min-device-pixel-ratio : 2.5){ }  

  18. /*mate7*/  
  19. @media only screen and (min-device-width :1080px) and (-webkit-min-device-pixel-ratio : 3){ }  

  20. /*4 4s*/  
  21. @media only screen and (device-height :480px) and (-webkit-device-pixel-ratio:2){ }  

  22. @media screen and (min-width: 320px) and (max-width: 480px) {  }  

  23. /* 平板之类的宽度 1024 以下设备 */  
  24. @media only screen and (min-width: 321px) and (max-width: 1024px) {  
  25. body {  
  26. background: blue;  
  27. }  
  28. }  

  29. /* PC客户端或大屏幕设备: 1028px 至更大 */  
  30. @media only screen and (min-width: 1029px) {  
  31. body {  
  32. background: green;  
  33. }  
  34. }  

  35. /* 竖屏 */  
  36. @media screen and (orientation:portrait) and (max-width: 720px) {对应样式}  

  37. /* 横屏 */  
  38. @media screen and (orientation:landscape){对应样式}  

  39. iPhone5s 504*320  
举报

相关推荐

媒体查询?

媒体查询~~~~~

~107媒体查询

媒体查询教案

设置媒体查询

浅谈媒体查询

前端之媒体查询入门

0 条评论