Home > Web Front-end > CSS Tutorial > How to Write Media Queries Targeting iPhone 6 and iPhone 6 Plus?

How to Write Media Queries Targeting iPhone 6 and iPhone 6 Plus?

Barbara Streisand
Release: 2024-11-30 10:58:09
Original
191 people have browsed it

How to Write Media Queries Targeting iPhone 6 and iPhone 6 Plus?

Media Queries for Targeting iPhone 6 and 6 Plus

iPhone 6

Landscape

@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)  // Deprecated: aspect-ratio
    and (aspect-ratio : 667/375)
    and (device-pixel-ratio : 2)
    and (-webkit-min-device-pixel-ratio : 2)
{ }
Copy after login

Portrait

@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)  // Deprecated: aspect-ratio
    and (aspect-ratio : 375/559)
    and (device-pixel-ratio : 2)
    and (-webkit-min-device-pixel-ratio : 2)
{ }
Copy after login

User Agent

# Safari
Mozilla/5.0 (iPhone; CPU iPhone OS 9_0 like Mac OS X) AppleWebKit/601.1.39 (KHTML, like Gecko) Version/9.0 Mobile/13A4305g Safari 601.1

# Google Chrome
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10 (000102)

# Mercury
Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53
Copy after login

Launch Images

  • 750 x 1334 (@2x) for portrait
  • 1334 x 750 (@2x) for landscape

App Icon

  • 120 x 120

iPhone 6 Plus

Landscape

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

Portrait

@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)
{ }
Copy after login

Launch Images

  • 1242 x 2208 (@3x) for portrait
  • 2208 x 1242 (@3x) for landscape

App Icon

  • 180 x 180

iPhone 6 and 6 Plus

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

Predicted Specifications

Based on Apple's website, the predicted specifications for the iPhone 6 Plus are:

@media screen 
    and (min-device-width : 1080px) 
    and (max-device-width : 1920px) 
    and (min-resolution: 401dpi) 
    and (device-aspect-ratio:16/9) 
{ }

@media screen 
    and (min-device-width : 750px) 
    and (max-device-width : 1334px) 
    and (min-resolution: 326dpi) 
{ }
Copy after login

Apple Watch (Speculative)

@media 
    (max-device-width:42mm) 
    and (min-device-width:38mm) 
{ }
Copy after login

The above is the detailed content of How to Write Media Queries Targeting iPhone 6 and iPhone 6 Plus?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template