我想改变导航背景颜色的透明度,但这也改变了导航链接的透明度。我该如何仅更改导航背景颜色的透明度?
这是我的导航样式:
#navigation {
height: 60px;
width: auto;
margin: 0 0 20px 0;
background-color: black;
border-radius: 8px;
opacity: 0.7;
}
#navigation ul {
list-style-type: none;
}
#navigation li {
padding-left: 22px;
float: left;
}
#navigation a {
text-decoration: none;
display: inline-block;
float: left;
padding: 10px 20px 10px 20px;
color: white;
margin-top: 10px;
opacity: 1;
}
#navigation a:hover {
background-color: orange;
border-radius: 10px;
}