Hey there, I'm facing an issue on my website with the second navbar where I display categories. Out of the 9 categories listed, 2 only have one line of text each. This causes the hover effect to only highlight the text line itself and not the entire block. Is there a way to make the hover effect cover the entire block for those categories with just one line?
This is the code snippet for the index:
<nav id="menu-h">
<ul>
<li><a href="catalogo.php">GoodCaring</a></li>
<li><a href="catalogo.php">Saúde e Higiene Sénior</a></li>
<li><a href="catalogo.php">Logística e <br>Indústria</a></li>
<li><a href="catalogo.php">Soluções de embalagem</a></li>
<li><a href="catalogo.php">Agricultura</a></li>
<li><a href="catalogo.php">Gestão de <br>Resíduos</a></li>
<li><a href="catalogo.php">Artigos de <br>Celulose</a></li>
<li><a href="catalogo.php">Artigos de Higiene e Limpeza</a></li>
<li><a href="catalogo.php">Embalagens Biodegradáveis</a></li>
</ul>
</nav>
#menu-h ul {
max-width: 1600px;
min-height: 57px;
list-style: none;
padding: 0;
margin: auto;
background-color: rgb(204, 204, 204);
}
#menu-h ul li{
display: inline;
}
#menu-h ul li a{
border-radius: 10px;
display: inline-block;
/*line-height: center;*/
vertical-align: middle;
transition: background .5s;
color: #483e3e;
text-align: center;
padding: 5px;
text-decoration: none;
font-size: 17px;
width: 10.80%;
}
#menu-h ul li a:hover {
background-color: rgb(166, 232, 57);
border-radius: 10px;
color: white;
border-bottom-style: inset;
border-bottom-width: 6px;
border-bottom-color: rgb(19, 83, 57);
text-align: center;
}
As shown in the screenshot, I want the hover effect on "Agricultura" to be the same as that on "Soluções de embalagem".
I attempted adding a <br> tag, but it caused the text to no longer align center. I also tried using Display block, but this resulted in the navbar stacking vertically.