运用CSS3媒体查询判断iPhoneX、iPhoneXR、iPhoneXS MAX及横竖屏
//iphoneX、iphoneXs
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
}
即: 設備屏幕可見寬度為375px, 可見高度為812px及設備像素比為3
?
//iphone Xs Max
@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio:3) {
}
?
//iphone XR
@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio:2) {
}
//橫屏
@media all and (orientation : landscape) {?
}?
?
//豎屏
@media all and (orientation : portrait){?
}?
轉載于:https://www.cnblogs.com/Miracle-ZLZ/p/10685228.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的运用CSS3媒体查询判断iPhoneX、iPhoneXR、iPhoneXS MAX及横竖屏的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 判断和循环
- 下一篇: 【题解】 P2151 [SDOI2009