I have create a navigation menu but the problem i face is that when i hover my mouse to the edge each menu block the ancor tag does not work, it works only when i place the mouse near the text. my question is that i want to make the whole block clickable any solutions?
Here a fiddle.
The markup.
<div id="nav">
<ul class="menu">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="/work/">Products</a></li>
<li><a href="/contact/">Careers</a></li>
<li><a href="/contact/">Contact</a></li>
</ul>
</div>
The CSS.
#nav {
width: 960px;
background: #222222;
}
.menu {
width: 960px;
margin: auto;
padding: 0;
list-style: none;
text-align: center;
}
.menu li {
display: block;
border-right: 5px solid #222222;
border-bottom: 3px solid #222222;
padding: 10px;
float: left;
width: 166px;
height: 20px;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
background: #0C5E91;
}
.menu li:hover {
background: #95d629;
}
.menu li a {
display: block;
float: left;
width: 140px;
height: 20px;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
.menu li a {
text-decoration: none;
color: white;
}