I am encountering an issue with a drop-down list where the bottom corners have a border-radius applied, and I would like to change the hover color of the li items. However, when hovering over the last item, the background-color covers up the border radius. How can I ensure that the border-radius of the parent container is maintained even when hovering over the last li item?
.menu {
max-width: 200px;
list-style: none;
padding: 0;
border: 1px solid #ccc;
border-radius: 0 0 10px 10px;
}
.menu .menu-item {
padding: 0.5rem;
border-bottom: 1px solid #ccc;
}
.menu .menu-item:last-child {
border-bottom: none;
}
.menu .menu-item:hover {
background-color: #222;
color: #fff;
}
<ul class="menu">
<li class="menu-item">A Menu Item Text</li>
<li class="menu-item">A Menu Item Text</li>
<li class="menu-item">A Menu Item Text</li>
<li class="menu-item">A Menu Item Text</li>
<li class="menu-item">A Menu Item Text</li>
</ul>