iphone - 移动 safari 中忽略的溢出 x 值

标签 iphone ios css html mobile-safari

我们将 body 和可滚动元素的 overflow-x 值设置为 hidden,但移动版 Safari 会忽略这些值。在桌面上,溢出值工作正常。

相关代码:

body { overflow-x:hidden; width:320px; height:100%; min-height:100%; margin:0; background:-webkit-linear-gradient(top,#e8e4dc,#f2f0eb); }

.page_list, .content { max-height:370px; box-sizing:border-box; padding:0; overflow-x:hidden; overflow-y:auto; -webkit-overflow-scrolling:touch }

#catalog_page { border-left:1px solid #CCC; z-index:28; position:absolute; top:0; width:200px; height:460px; background:white; -webkit-transition:-webkit-transform 0.1s ease-in;; -webkit-transform:translate3d(0,0,0); display:none; }

catalog_page 位于视口(viewport)之外,只有在有人做出手势后才会滑入 View 。

重现:

1) 访问www.tekiki.com在你的 iPhone(不是 iPad)上。向右滚动,您将看到 catalog_page 如何扩展网站的宽度,即使我们固定了正文宽度。

最佳答案

添加 html { overflow: hidden; } 添加到您的 CSS,它应该会修复它。

关于iphone - 移动 safari 中忽略的溢出 x 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17767176/

相关文章:

html - 使用 HTML/CSS 构建公共(public)信息显示的资源?

iphone - 在 Xcode 4.2 的 UIWebView 中加载网页——如何正确连接 IBOutlets 并确保网页加载?

ios - 将 UISearchBar 背景更改为自定义图像的正确方法是什么?

iphone BPM 速度按钮

ios - 关闭已由呈现 View Controller 呈现的呈现 View Controller

html - 为什么绝对 parent 得到 child 的高度而相对 parent 没有?

iphone - 无法打开可执行文件 - xcode

ios - 我可以在 UIScrollView 中使用 UIRefreshControl 吗?

ios - "Glitch"在 UIView 介绍 CAAnimation 期间

html - Angular Material : Prevent layout resizing when select box value is chosen