Forum Moderators: open
I used CSS, the background-color: black; attribute for the a.hover tag, in order to have the background of the anchor link change color when the mouse is over it.
But the problem is that I want the "box" around the link words is too large, I want to restrict it to be just as big as the letters.
Is there a way to do it with CSS?
I tried the old way, putting each link in their own table cell, but it still doesn't work, it's still the same size of the anchor box.
Thanks
#nav li a { margin:0; padding:0; }
#nav { text-align: center; }
#nav li {
display:inline;
margin:0;
padding: 6px;
}
<ul id="nav">
<li><a href="#">nav one</a></li>
<li><a href="#">nav two</a></li>
<li><a href="#">nav three</a></li>
</ul>