我遇到了下拉导航栏的问题,当我在css中定义位置时,下拉导航将在图像后面。我希望你理解我的问题。请帮助我,也对不好的英语抱歉。
.img-slider-ul {
list-style: none;
margin: 0;
padding: 0;
height:350px;
overflow:hidden;
position:relative;
}
.img-slider-li {
position:absolute;
}
.img-slider{
border: 1px solid #000;
border-radius: 3px;
box-shadow: 0 0 5px 0 hsla(0,0%,30%, .3);
height:350px;
}
.img-slider-li:nth-child(4) {
animation: xfade 16s 0s infinite;
}
.img-slider-li:nth-child(3) {
animation: xfade 16s 4s infinite;
}
.img-slider-li:nth-child(2) {
animation: xfade 16s 8s infinite;
}
.img-slider-li:nth-child(1) {
animation: xfade 16s 12s infinite;
}
@keyframes xfade{
17% {
opacity:1;
}
25% {
opacity:0;
}
92% {
opacity:0;
}
}
<ul class="img-slider-ul">
<li class="img-slider-li"><img class="img-slider" title="" alt="css3" src="https://image.ibb.co/dnt83v/img01.png" /></li>
<li class="img-slider-li"><img class="img-slider" title="" alt="css3" src="https://image.ibb.co/iJuFiv/img02.png" /></li>
<li class="img-slider-li"><img class="img-slider" title="" alt="css3" src="https://image.ibb.co/nf8VGF/img03.png" /></li>
<li class="img-slider-li"><img class="img-slider" title="" alt="css3" src="https://preview.ibb.co/hJZ4bF/img04.png" /></li>
</ul>
答案 0 :(得分:0)
添加'下拉菜单'与滑块部分
相比,Z-index应该为高 .img-slider-ul {
list-style: none;
margin: 0;
padding: 0;
height:350px;
overflow:hidden;
position:relative;
z-index:99;
}
用于下拉菜单类添加z-index:999;
答案 1 :(得分:0)
只需在滑块ul
中使用run()
即可
z-index:0;