首页 >web前端 >css教程 >如何为 iPhone 6 和 6 Plus 编写特定于尺寸的媒体查询?

如何为 iPhone 6 和 6 Plus 编写特定于尺寸的媒体查询?

Linda Hamilton
Linda Hamilton原创
2024-12-06 05:48:14640浏览

How to Write Size-Specific Media Queries for iPhone 6 and 6 Plus?

iPhone 6 和 6 Plus 的特定尺寸媒体查询

iPhone 6

  • 风景:

    @media only screen 
        and (min-device-width : 375px) // or 213.4375em or 3in or 9cm
        and (max-device-width : 667px) // or 41.6875em
        and (width : 667px) // or 41.6875em
        and (height : 375px) // or 23.4375em
        and (orientation : landscape) 
        and (color : 8)
        and (device-aspect-ratio : 375/667)
        and (aspect-ratio : 667/375)
        and (device-pixel-ratio : 2)
        and (-webkit-min-device-pixel-ratio : 2)
    { }
  • 肖像:

    @media only screen 
        and (min-device-width : 375px) // or 213.4375em
        and (max-device-width : 667px) // or 41.6875em
        and (width : 375px) // or 23.4375em
        and (height : 559px) // or 34.9375em
        and (orientation : portrait) 
        and (color : 8)
        and (device-aspect-ratio : 375/667)
        and (aspect-ratio : 375/559)
        and (device-pixel-ratio : 2)
        and (-webkit-min-device-pixel-ratio : 2)
    { }

iPhone 6加

  • 风景:

    @media only screen 
        and (min-device-width : 414px) 
        and (max-device-width : 736px) 
        and (orientation : landscape) 
        and (-webkit-min-device-pixel-ratio : 3) 
    { }
  • 肖像:

    @media only screen 
        and (min-device-width : 414px) 
        and (max-device-width : 736px)
        and (device-width : 414px)
        and (device-height : 736px)
        and (orientation : portrait)
        and (-webkit-min-device-pixel-ratio : 3) 
        and (-webkit-device-pixel-ratio : 3)
    { }

启动图像和图标

iPhone 6

  • 启动图像:

    • 肖像:750 x 1334 (@2x )
    • 风景: 1334 x 750 (@2x)
  • 应用程序图标:120 x 120

iPhone 6 Plus

  • 启动图片:

    • 纵向:1242 x 2208 (@3x)
    • 横向:2208 x 1242 (@3x)
  • 应用程序图标: 180× 180

一般

  • 两者:

    @media only screen 
        and (max-device-width: 640px), 
        only screen and (max-device-width: 667px), 
        only screen and (max-width: 480px)
    { }

以上是如何为 iPhone 6 和 6 Plus 编写特定于尺寸的媒体查询?的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn