【问题标题】:Fixed header is over scrollbar固定标题在滚动条上方
【发布时间】:2018-03-12 16:06:07
【问题描述】:

我有一个固定的标题,它隐藏了滚动条的顶部。 这是由在hmtl 和body 上设置overflow: auto 引起的。 但是,如果我不这样做,它会破坏移动浏览器(Firefox 除外)上的浮动标题。

我不知道在这做什么,似乎我要么在滚动条上有标题,要么在移动浏览器上有一个损坏的固定标题。

Here's an example.

    html, body {
        height: 100%; width: 100%;
        margin: 0;
        overflow: auto;
    }

    header {
        position: fixed; top: 0; left: 0;
        width: 100%; height: 7.5em;
        z-index: 1000;
    }

【问题讨论】:

    标签: scrollbar overflow css-position mobile-browser


    【解决方案1】:

    我从body 中删除了overflow: auto,并将user-scalable=no 添加到<meta content='width=device-width,initial-scale=1' name='viewport'>。这样就行了。

    见this answer

    【讨论】:

      猜你喜欢
      • 2021-01-26
      • 2014-09-15
      • 2017-07-23
      • 2012-07-29
      • 1970-01-01
      • 2019-12-13
      • 2015-01-27
      • 2018-06-25
      • 1970-01-01
      相关资源
      最近更新 更多