I am working on a simple menu code, which is just a list of items.
ul li {
position: relative;
top: 55px;
height: 30px;
background: #212;
display: inline-block;
width: 29%;
margin: 1%;
margin-bottom: 0;
padding: 5px;
-webkit-border-top-right-radius: 30px;
-moz-border-top-right-radius: 30px;
-ms-border-top-right-radius: 30px;
-o-border-top-right-radius: 30px;
border-top-right-radius: 30px;
-webkit-border-top-left-radius: 30px;
-moz-border-top-left-radius: 30px;
-ms-border-top-left-radius: 30px;
-o-border-top-left-radius: 30px;
border-top-left-radius: 30px;
}
ul li:hover {
box-shadow: 1px 1px 10px white;
position: relative;
top: 20px;
height: 60px;
padding-top: 1.5em;
font-size: 20px;
}
<ul>
<a href="#">
<li>MENU</li>
</a>
<a href="#">
<li>CARDS</li>
</a>
<a href="#">
<li>CONTACT</li>
</a>
</ul>
After applying this code, I noticed that the `padding-top` and `font-size` properties affect all list items, not just the one I hover over.
If I remove these two properties, the `box-shadow` and relative positioning only apply to the item being hovered over.
Is there a way to modify the code so that it only affects the button I am hovering over without assigning individual IDs to each button?