I'm wondering how I can make the :hover property only affect individual letters in my navigation bar, instead of hovering over the entire box.
* {
margin: 0px;
padding: 0px;
}
.navigation-bar {
height: 3.2em;
background: gray;
text-align: center;
border-top: 2px solid;
border-bottom: 2px solid;
}
.navigation-bar ul {
display: inline-block;
list-style-type: none;
}
.navigation-bar li {
display: inline;
}
.navigation-bar li a {
color: white;
padding: 0px 30px;
margin: 1em 0 0 -2px;
text-decoration: none;
float: left;
height: 1.2em;
line-height: 1.2em;
}
.navigation-bar li a:hover,
a:focus {
background-color: #111;
}
<!DOCTYPE html>
<link rel="stylesheet" href="navbar1.css">
<div class="navigation-bar">
<div id="navigation-container">
<ul>
<li><a href="#">Home</a>
</li>
<li><a href="#">Gallery</a>
</li>
<li><a href="#">About</a>
</li>
<li><a href="#">Contact</a>
</li>
</ul>
</div>
</div>
</html>
Check out my code example: https://jsfiddle.net/uz081886/
Currently, when hovering over a tab, a black bar appears. How can I change it so that only the letters of each word are highlighted? For example, when hovering over "Home", the text color would turn black without the black bar appearing?