0
我附上显示我的下拉菜单的图像。问题是,您仍然可以看到下拉菜单背后的文字。我希望它是深蓝色的,所以它背后的文字可以隐藏起来。我怎样才能改变这与CSS,使背景不会让我看到它背后的文字? 正如你可以在图像上看到的,通过下拉菜单可以看到ns。过去的12个月有点重叠。我怎样才能让我的深蓝色背景下拉不透明
这里是标签的CSS代码
.menu_button {
width: 19%;
height: 30px;
background: #1A3F73;
float: left;
margin-right: 5px;
margin-bottom: 10px;
text-align: center;
border: 1px solid black;
border-radius: 5px;
color: #f4f442;
font-weight: bold;
font-size: 13px;
}
.menu_button ul {
margin-top: 10px;
background: #1A3F73;
list-style-type: none;
width: 100%;
display: none;
margin-left: 0px;
background: rgba(128,128,128,0.7);
}
.menu_button li {
height: 30px;
background: #1A3F73;
margin: 0px;
width: 100%;
opacity: 1;
}
HTML
<a style='color:#f4f442;' href ='course/view.php?id=11'><div class ='menu_button'><span class='middle daily'>Daily Magic Spells</span><br /><div class='dd'><ul><li class='recent'><a style='color:#f4f442' href='recent.php'>Most recent leaders</a></li><li class='threem'><a style='color:#f4f442' href='three-month.php'>last 3 months</a></li><li class='sixm'><a style='color:#f4f442' href='six-month.php'>last 6 months</a></li><li class='twelvem'><a style='color:#f4f442' href='year.php'>last 12 months</a></li></ul></div></div></a>
没有实际的代码,这是不可能的帮助 – Dekel
我添加了代码 – user1787184
这只是一行代码。建立一个完整的例子(jsfiddle.net/snippet/codepen) – Dekel