我试图将z-index放到我的标头类中,但仍然无法正常工作。当我向下滚动时,关于位置和后续滚动的一切都很好,但是标题的背景变为透明。
我的CSS
#collection-5de6d28545f1a7075b7a2741 #canvas {
min-height: calc(100vh - 11px);
}
我的js
.header {
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 10%, rgba(0, 0, 0, 0));
background-position: fixed;
overflow: hidden;
padding: 0 4%;
z-index: 10000;
height: 70px;
}
.fixed {
position: fixed;
top: 0;
left: 0;
width: 100%;
animation: smoothScroll 1s forwards;
}
@keyframes smoothScroll {
0% {
transform: translateY(-70px);
}
100% {
transform: translateY(0px);
}
}
答案 0 :(得分:0)
我解决了将另一个背景添加到“ .fixed”类的问题。所以现在可以了。