【问题标题】:Horizontal Scroll - Mac Safari only水平滚动 - 仅限 Mac Safari
【发布时间】:2016-06-08 17:13:43
【问题描述】:

我正在获得水平滚动,但仅限于 Mac Safari。我无法在其他地方复制该问题,而且很难排除故障(为此我通常在 Firefox 上使用 Firebug)。

网址是

http://getinjuryanswers.com 

我很乐意粘贴代码,但我什至不确定要定位什么代码。

任何反馈都将不胜感激。

谢谢。

【问题讨论】:

  • 我没有在主页中看到任何水平滚动
  • 您是否尝试过隐藏在您的 CSS 正文部分中的任何内容。

标签: css


【解决方案1】:

overflow: hidden 添加到最外层的包装以修复滚动条问题:

.site-container {
    overflow: hidden;
}

为了避免这个滚动条问题,我总是使用以下结构,它从不打扰我..

HTML:

<html>
    <head></head>
    <body>
        <div class="wrapper">
             <header class="header></header>
             <main class="main></main>
             <footer class="footer"></footer>
        </div>
    </body>
</html>

CSS:

body {
    margin: 0;
    // and other necessary properties for your page.
}
.wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

【讨论】:

  • 谢谢。那行得通。不知道为什么以前没有。
【解决方案2】:

试试这个,

html { overflow-x: hidden; }
body { overflow-x: hidden; }

【讨论】:

    猜你喜欢
    • 2011-02-04
    • 1970-01-01
    • 1970-01-01
    • 2012-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-15
    • 1970-01-01
    相关资源
    最近更新 更多