I know how to change background of my list on hover, however, when I do it, the background is to small, it's just around the text, but I want it to be bigger and i dont know how please help.
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
}
.nav-bar ul {
display: flex;
justify-content: flex-end;
background-color: rgb(48, 46, 46);
}
.nav-bar ul li {
margin: 20px;
margin-right: 50px;
padding-left: 50px;
list-style: none;
font-size: 22px;
font-weight: bold;
}
.nav-bar ul li a {
display: block;
text-decoration: none;
color: white;
}
.nav-bar ul li a:hover {
background-color: rgb(118, 116, 113);
border-radius: 5px;
}
</style>
<body>
<nav class="nav-bar">
<ul>
<li><a href="#">menu</a></li>
<li><a href="#">contact</a></li>
<li><a href="#">about us</a></li>
<li><a href="#">download</a></li>
</ul>
</nav>
</body>
Currently it looks like below, where I want that grey area on the hover to be bigger, to cover the height of the navbar.
