2016-11-30 63 views
0

我附上顯示我的下拉菜單的圖像。問題是,您仍然可以看到下拉菜單背後的文字。我希望它是深藍色的,所以它背後的文字可以隱藏起來。我怎樣才能改變這與CSS,使背景不會讓我看到它背後的文字? enter image description here 正如你可以在圖像上看到的,通過下拉菜單可以看到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> 
+2

沒有實際的代碼,這是不可能的幫助 – Dekel

+0

我添加了代碼 – user1787184

+0

這只是一行代碼。建立一個完整的例子(jsfiddle.net/snippet/codepen) – Dekel

回答

1

你需要的,如果你改變

從您的RGBA背景顏色

.test{ 
    height: 100px; 
    width: 100px; 
    background-color: rgba(26,63,115, .5) 
} 

除去混濁

background-color: rgba(26,63,115, .5) 

background-color: rgba(26,63,115, 1) 

它將刪除不透明度使顏色固體

與您的代碼變化

.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 ul { 
    margin-top: 10px; 
    background: #1A3F73; 
    list-style-type: none; 
    width: 100%; 
    display: none; 
    margin-left: 0px; 
    background: rgba(128,128,128,1); 
} 
相關問題