【问题标题】:Iphone X media queries applying to iphone 8 plus alsoIphone X 媒体查询也适用于 iphone 8 plus
【发布时间】:2018-09-19 22:23:03
【问题描述】:

我正在为 iPhoneX 添加样式,但它甚至也反映在 iPhone 6、7、8 plus 设备上。

正在撰写媒体查询

@media only screen and (min-device-width : 375px) and (max-device-width : 812px) and (-webkit-device-pixel-ratio : 3)and (orientation : portrait){
      margin-top: 5%;
}

甚至尝试添加 iPhone6、7、8 plus 设备特定的媒体查询并提供margin-top: 0%

但这也没有用。任何答案都会有很大帮助。

【问题讨论】:

    标签: angularjs angular ionic-framework iphone-x iphone-8-plus


    【解决方案1】:

    iPhoneX

    @media only screen 
    and (min-device-width : 375px) 
    and (max-device-width : 812px)
    and (-webkit-device-pixel-ratio : 3) { /* STYLES GO HERE */}
    

    iPhone 6,7,8

    @media only screen 
    and (min-device-width : 375px) 
    and (max-device-width : 667px) { /* STYLES GO HERE */}
    

    【讨论】:

      猜你喜欢
      • 2018-03-01
      • 2023-03-04
      • 2019-11-16
      • 2016-08-15
      • 2014-11-03
      • 2014-06-19
      • 2013-01-26
      • 2016-04-27
      相关资源
      最近更新 更多