@media媒体查询判断iPhone各版本

/*iPhone5和iPhone SE*/
@media only screen 
    and (device-width : 320px) 
    and (device-height : 568px) 
    and (-webkit-device-pixel-ratio : 2) {
    /*code*/
 }

 /* iPhone6/7/8 */
@media only screen 
and (device-width : 375px) 
and (device-height : 667px) 
and (-webkit-device-pixel-ratio : 2) {
    /*code*/
}

 /* iPhone6/7/8 Plus*/
 @media only screen 
 and (device-width : 414px) 
 and (device-height : 736px) 
 and (-webkit-device-pixel-ratio : 3) {
     /*code*/
 }

  /* iPhoneX*/
  @media only screen 
  and (device-width : 375px) 
  and (device-height : 812px) 
  and (-webkit-device-pixel-ratio : 3) {
      /*code*/
  }

 

posted @ 2020-03-05 15:28  cdgogo  阅读(1445)  评论(0编辑  收藏  举报