I've been working on a navigation bar for my website for a few days now. However, I'm having trouble centering it and using margin auto
doesn't seem to be working. Here's the HTML code I have:
<!DOCTYPE html>
<html>
<head>
<title>Homepage - Trolltime</title>
<link rel="stylesheet" type="text/css" href="default.css">
</head>
<body>
<ul id="nav">
<li><a href="">Home</a></li>
<li><a href="">News</a></li>
<li><a href="">Contact</a></li>
<li><a href="">About</a></li>
<li><a href="">About</a></li>
</ul>
</body>
</html>
Below is my CSS code:
li:hover {font-size:120%}
li:visited{color:black}
ul.nav {
display: inline-block;
list-style-type: none;
}
li{
display:inline;
float:left;
margin:auto;
list-style-type:none;
font-family:Verdana;
display:block;
width:100px;
}
ul { list-style-type:none; }
body { background-color:#33CCFF; }
Any help would be appreciated. Thank you.