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

后端 未结 10 1081
隐瞒了意图╮
隐瞒了意图╮ 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 09:55

    I fixed this problem using the background property with a color, you can use var even if you'd like to

    .header{
        width:100%;
        position:fixed;
        z-index:10;
        background:blue;
        /* background: var(--my-var-value);  You can do this if needed*/
    }
    

提交回复
热议问题