Hide scrollable content behind transparent fixed position divs when scrolling the page?

后端 未结 10 1063
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 09:16

I have a div called header that is set up with a fixed position. The problem is when I scroll the page the content of the page shows up behind the header (the header is tran

10条回答
  •  既然无缘
    2020-12-01 10:05

    1. I have fixed background image
    2. The header background is transparent
    3. I don't want my content to override my transparent header

    I came up with a solution scrolling the div instead the body:

    .header { position: fixed; ... } .content { position: fixed; height: calc(100% - HEADER_HEIGHT); overflow: scroll; }

提交回复
热议问题