【发布时间】:2018-05-04 03:32:06
【问题描述】:
在所有设备上滚动都有效,但在 iPhone 上无效
@media only screen and (-webkit-min-device-pixel-ratio: 0) {
@supports (-webkit-overflow-scrolling: touch) {
body {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
-webkit-text-size-adjust:none;
height: 1300px!important;
position: relative!important;
background-image: radial-gradient(circle at center , #0c505f, #053540 );
color: #0c505f;
width: 95%!important;
}
【问题讨论】:
-
对于那些从搜索到这里的人,请确保您没有将主包装器(如#app)作为弹性容器。这会破坏 iOS/iPadOS 上的滚动。相反,我使用了
position: fixed;,它起作用了,尽管我确信它可能是相对的或绝对的。我也用过height: 100vh; overflow-y: auto;。
标签: ios css iphone scroll webkit