I'm making a horizontal menu and I want each element of this menu to have a 20px box. Now I want you to move your mouse by cimam to change that color.
For this I thought that if I used a:hover
I would solve the problem. Just not. It instead of changing the color of the box changes only the color back of each word.
Then I thought that giving padding
to a:hover
resolved. Only not.
Look at the example: note that the goal is for the color of the ahover to be filled in the entire box of the elements.
HTML
<ul>
<li><a href="inicio.html">Inicio</a></li>
<li><a href="ajuda.html">Ajuda</a></li>
<li><a href="contatos.html">Contatos</a></li>
</ul>
CSS
ul {
display: inline;
margin: 0px;
padding: 0px;
}
li {
margin: 10px;
padding: 12px;
}
a:hover {
background-color: red;
}