html - padding or margin wrong or both -
i tried divs in html, , isn't problem. encountered problem , don't find mistake.
the menu div supposed in center of header div , there should no margin @ top.
here example error: http://jsfiddle.net/j83eb/
here html:
<div id="header"> <div id="menu"> <ul> <li><a class="nav-element" href="#">news</a></li> <li><a class="nav-element" href="#">turnier</a></li> <li><a class="nav-element" href="#">ergebnisse</a></li> <li><a class="nav-element" href="#">impressionen</a></li> <li><a class="nav-element" href="#">anmeldung</a></li> <li><a class="nav-element" href="#">impressum</a></li> </ul> </div> </div>
and css:
#header { padding: 0; margin:0; background: #003399; width: 100%; height: 50px; display: block; position: fixed; top: 0; left: 0; } #menu { display: block; width: 150px; height: 50px; } #menu { padding:0; margin-right:auto; margin-left:auto; line-height:50px; width: 950px; height: 50px; } #menu ul li { display: block; width: 150px; height: 50px; float: left; text-align: center; text-transform: uppercase; font-family: arial; font-size: 16px; font-weight: normal; list-style: none; margin:0; paddin:0; line-height:50px; } .nav-element:link { color: #fff; text-decoration: none; } .nav-element:visited { color: #fff; text-decoration: none; background: #81b4e3; } .nav-element:hover { text-decoration: none; color: #fff; text-decoration: none; background: #1a589d; } .nav-element:active { color: #fff; text-decoration: none; background: #c00; }
thanks!
Comments
Post a Comment