Im無法讓旋轉的div不能延伸通過視口的底部。在android上發生的事情很好,但在iOS設備上,它允許窗口垂直滾動。在旋轉div時用css強制大小視口
div的css如下。
* {
padding: 0;
margin: 0;
}
body {
background-color: #030C22;
overflow: hidden;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-touch-action: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.BadOrientation {
background-image: url('assets/preloader/rotateDevice.png');
background-repeat: no-repeat;
background-position: center;
background-size: contain;
position: absolute;
height: 100%;
width: 100%;
}
.BadOrientation--Landscape {
-ms-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
違規的div是。
<div id="noLandscape" class="BadOrientation BadOrientation--Landscape" style="visibility: hidden; background-size: contain;"></div>
在android瀏覽器上,這似乎工作正常,用戶無法滾動,但在iOS設備上,用戶可以垂直滾動。我似乎不能讓它旋轉,並獲得溢出隱藏。
的可能的複製[溢出:隱藏不工作(https://stackoverflow.com/questions/3970455/overflow -hidden-not-working) –
是的。謝謝 –