Hello,
I am unable to get my css menu working properly. I want the hover to have the same height and width as the navigation list. When i set the width on the hover it doesn’t work, only works when i set the padding. The problem with padding is inconsistent for the menu because the word doesn’t have equal amount of letters.
Here is my html code:
<body>
<div id="header">
<div id="navcontainer">
<ul>
<li><a href="#">About us</a></li>
<li><a href="#">Service</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Development</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
<div id="content">
<p>We believe that our strengths reside within our core values. Our fundamentals are honesty, trustworthy, quality, ethical, responsible and innovative. </p>
</div>
<div id="footer">
</div>
</body>
Here is my css code:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
margin:0 auto;
background-color: #fff;
}
ol, ul {
list-style: none;
}
/* ----- HEADER ----- */
#header {
height:150px;
padding-top: 20px;
background-color: #00CC99;
}
h1 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 19px;
}
.logo {
margin: auto;
width: 760px;
}
/* ----- NAVIGATION ----- */
#navcontainer {
width: 760px;
margin: 99px auto 0;
clear: both;
height:32px;
color: #FFF;
font-family: Geneva, Arial, Helvetica, sans-serif;
text-align: center;
}
li {
display: inline;
letter-spacing: 2px;
float: left;
margin: 0 2px 0 0;
width: 150px;
display: inline;
padding: 10px 0px;
background: #222222;
font-size: 12px;
font-weight:100;
text-align: center;
color: #FFFFFF;
text-transform: uppercase;
}
li a {
text-decoration: none;
color: #FFF;
}
li a:hover {
background-color: #009966;
color: #222;
}