Take a look at the code snippet below:
ul.parent li:hover{
background-color: red;
}
/* ul.parent li:hover .child{
background-color: white;
} */
<ul class="parent">
<li><a href=""> App </a></li>
<li>
<a href=""> Components </a>
<ul class="child">
<li><a href=""> Badge </a></li>
<li><a href=""> Dropdown </a></li>
<li><a href=""> Navbar </a></li>
<li><a href=""> Modal </a></li>
</ul>
</li>
</ul>
On hovering over 'Components', both the list item and the child ul change their background color. This is not the desired behavior. What I want is for only the list item to change on hover, leaving the ul unchanged. How can I achieve this? Thank you in advance.