我已经为我的菜单背景设置了background-image
,至于菜单后面的黑条:
http://www.cochlea.co.il/
background-image: url("http://www.cochlea.co.il/wp-content/uploads/2015/07/bar.png");
background-repeat: no-repeat;
background-position: inherit;
但是,有时无法加载黑色背景。有时当您向下滚动然后向上滚动时,它会消失。
有什么问题?
非常感谢。
最佳答案
我注意到每当我们向下滚动时它就会隐藏起来。
好吧,如果您删除背景图像并允许背景为黑色怎么样?
使用此代码
.main-navigation ul {
list-style: none;
margin: 0;
display: inline;
background: #000;
padding: 5px;
border-radius: 28px;
padding-left: 30px;
padding-right: 30px;
}
.theNavigationBar {
position: absolute;
width: 100%;
top: 15px;
left: 0;
text-align: center;
font-weight: bold;
/* background-image: url("http://www.cochlea.co.il/wp-content/uploads/2015/07/bar.png"); */
/* background-repeat: no-repeat; */
/* background-position: inherit; */
/* letter-spacing: 0.5px; */
}
它的作用与背景图像的作用相同。所以简单地使用上面的代码。
关于CSS - 背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31368878/