运用CSS3媒体查询判断iPhoneX、iPhoneXR、iPhoneXS MAX及横竖屏
//iphoneX、iphoneXs
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
}
即: 設(shè)備屏幕可見(jiàn)寬度為375px, 可見(jiàn)高度為812px及設(shè)備像素比為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){?
}?
轉(zhuǎn)載于:https://www.cnblogs.com/Miracle-ZLZ/p/10685228.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的运用CSS3媒体查询判断iPhoneX、iPhoneXR、iPhoneXS MAX及横竖屏的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 判断和循环
- 下一篇: CSS中margin和padding的区