I'm facing an issue with the sub-navigation menu on my website. The problem is that the <a>
tag containing the text "Mathematik & Naturwissenschaften" doesn't resize properly when the browser window is small enough for the words to wrap. The desired appearance is without the "empty gray space".
ul#subnavi a {
float: left;
font-size: 0.8em;
letter-spacing: 1px;
text-decoration: none;
color: #fff;
padding: 10px;
padding-top: 2px;
padding-bottom: 5px;
margin-bottom: 10px;
font-weight: bold;
line-height: 150%;
background-color: #9c9e9f;
clear: left;
}
ul#subnavi {
list-style-type: none;
}
<ul id="subnavi">
<li><a href="XYZ">Sprachen</a></li>
<li><a href="XYZ">Gesellschaftswissenschaften</a></li>
<li><a href="XYZ">Mathematik & Naturwissenschaften</a></li>
<li><a href="XYZ">künstlerisch-musische Fächer</a></li>
<li><a href="XYZ">Religion</a></li>
<li><a href="XYZ">Sport</a></li>
</ul>