When working with my MVC Razor layout view, I encountered an issue where I couldn't set the background color of my dropdown list on mouse hover:
The dropdown list appears like this:
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Partner <b class="caret"></b></a>
<ul class="dropdown-menu" style="background-color:#080808">
<li class="marv-main-li">@Html.ActionLink("Test1", "Action1", "Partner")</li>
<li class="marv-main-li">@Html.ActionLink("Test2","Action2","Partner")</li>
<li class="marv-main-li">@Html.ActionLink("Test3","Action3","Partner")</li>
<li class="marv-main-li">@Html.ActionLink("Test4","Action4","Partner")</li>
</ul>
</li>}
My attempted CSS solution did not work:
.dropdown .dropdown-menu .li a:hover {
background-color: #06fa12;
}
How can I successfully change the background color of the text in the dropdown list upon mouse hover?
It's important to note that I am using Twitter Bootstrap 3.