Browsers scrollbar is under my fixed div

后端 未结 10 2142
抹茶落季
抹茶落季 2020-12-05 09:25

i have a fixed header with 100% width.

#header {
background: #2e2e2e;
width: 100%;
z-index: 999;
position: fixed;
}

browsers scrollbar is u

相关标签:
10条回答
  • 2020-12-05 09:34

    Set a z-index on the container that is the parent for your header and your content.

    0 讨论(0)
  • 2020-12-05 09:40

    remove height:100% in html tag

    0 讨论(0)
  • 2020-12-05 09:43

    Had same problem in react app.

    Moved overflow-y: scroll style from #root to body selector. It solved issue for me.

    0 讨论(0)
  • 2020-12-05 09:45

    its because the overflow-x: hidden; in base.css line number 9

    body {
        color: #444444;
        font: 13px/20px Arial,Helvetica,sans-serif;
        overflow-x: hidden; // remove this 
    }
    
    0 讨论(0)
  • 2020-12-05 09:45

    put margin-right: 0px; on topNavBar works for me

    0 讨论(0)
  • 2020-12-05 09:47

    The issue isn't with overflow-x on the body tag. It's because of overflow-x andoverflow-y on the html tag. Once I removed this from the HTML tag, I could put whatever overflow I wanted on my body.

    This happens when:

    • overflow-x is set to either auto, hidden, overflow, or scroll
    • overflow-y is set to either auto, hidden, -webkit-paged-x, or -webkit-paged-y

    It doesn't have to be an explicit call to overflow-x or overflow-y, as overflow sets both of them.

    I'm on Chrome 67 using Windows 10.

    0 讨论(0)
提交回复
热议问题