如何在不影响 iPhone 缩放的情况下创建全浏览器宽度的栏?
我正在尝试创建在屏幕上一直延伸的颜色条 http ://css-tricks.com/9443-full-browser-width-bars/ 并且不可能重新排列 DOM 以使其更容易。
该技术在桌面浏览器上非常棒,但在移动设备上,WebKit 溢出-x 并未隐藏,您可以放大、缩小或滚动到仅包含令人难以置信的宽颜色条的页面部分。设置视口没有帮助。
如何在不破坏变焦的情况下获得这种效果?
I am trying to create bars of color that stretch all the way across the screen as http://css-tricks.com/9443-full-browser-width-bars/ and it is not possible to rearrange the DOM to make this easier.
The technique is awesome on desktop browsers, but on mobile WebKit overflow-x is not hidden and you can zoom way, way out or scroll over to parts of the page that only contain improbably-wide color bars. It doesn't help to set the viewport.
How do I get this effect without screwing up the zoom?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过将
overflow-x:hidden;
添加到滚动条的父元素?我发现这种技术在开发基于 webkit 的移动浏览器时非常有用。Have you tried to adding
overflow-x: hidden;
to the parent element of the scroll-bars? I have found this technique useful when developing for webkit based mobile browsers.