Browsers scrollbar is under my fixed div

后端 未结 10 2255
抹茶落季
抹茶落季 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: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.

提交回复
热议问题