![](/img/trans.png)
[英]How to disable vertical scrolling but keep horizontal scrolling on iOS-devices?
[英]How to disable horizontal scrolling on a website for iOS (CSS)
我似乎无法在 CSS 中为 iOS 禁用水平滚动。我需要在侧面增加额外的宽度来为导航栏腾出空间,因此禁用它对我来说至关重要。
我试过了
html,
body {
overflow: hidden;
overflow-x: hidden;
max-width: 100%;
-ms-overflow-style: none;
scrollbar-width: none;
}
html::-webkit-scrollbar {
display: none;
}
body::-webkit-scrollbar {
display: none;
}
但我仍然可以在我的 iPhone 上水平滚动代码应该在https://infinity6542.netlify.app
你有没有尝试过
*{
overflow: hidden;
}
我相信溢出属性就足够了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.