移动端判断横屏竖屏
1. CSS判斷橫屏豎屏
寫在同一個CSS中
@media screen and (orientation: portrait) {
/*豎屏 css*/
}
@media screen and (orientation: landscape) and (min-width:450px){
/*橫屏 css*/
}
分開寫在2個CSS
豎屏
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
橫屏
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css">
2. JS判斷橫屏豎屏
?
轉載于:https://www.cnblogs.com/mengff/p/5395921.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
- 上一篇: 九宫格拼图 支持44 55等
- 下一篇: UI-UIScrollView