在所有设备上滚动都有效,但在 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;
}
最佳答案
When you dynamically add content to a div with -webkit-overflow-scrolling: touch; that exceeds the div in height, it becomes broken and unscrollable. You can fix this by constantly having an inner div, that triggers the scrollbar because its 1px higher than the outer div: - (Patrick Muff)
.outer {
overflow: scroll;
-webkit-overflow-scrolling: touch;
/* More properties for a fixed height ... */
}
.inner {
height: calc(100% + 1px);
}
关于ios - 滚动在 iPhone 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50162478/