2017-10-29 126 views
1

我试图通过在顶部显示标题而不衰减来实现幻灯片显示。 我无法做that.Can有人帮助我在改变代码,以便幻灯片标题无法添加幻灯片而不隐藏标题

这里开始下的是链接到我的codepen

https://codepen.io/arunkayathi/pen/EbxpEv

#landing-header { 
    background-repeat: no-repeat; 
    background-size:100%; 
    z-index: 1; 
    position: relative; 
    width:340px; 
    height:174px; 
    text-align: center; 
    margin:0 auto; 
    padding-top: 37vh; 
} 
#landing-content{ 
    padding:40px 0; 
} 
#landing-header{ 
    color:white; 
} 
.slideshow { 
    position: fixed; 
    width: 100%; 
    height: 100%; 
    top: 0; 
    left: 0; 
    z-index: 0; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
} 
.slideshow li { 
    width: 100%; 
    height: 100%; 
    position: absolute; 
    top: 0; 
    left: 0; 
    background-size: cover; 
    background-position: 50% 50%; 
    background-repeat: no-repeat; 
    opacity: 0; 
    z-index: 0; 
    animation: imageAnimation 50s linear infinite; 
} 

请点击链接并找到它的全部代码

+0

如果我没有记错的话,你想在最顶部的标题/导航在任何时候都保持可见,但它目前正与滑动变化淡入淡出? – Chris

+0

是的,这是正确的克里斯 – arun

回答

1

您只需要在nav元素上添加一个z-index。

添加到您的CSS

nav { 
    z-index:10; 
}