First of all, you have your <li> and <a> tags reversed.
It's <li><a>text</a></li>, not <a><li>...
You can't place a block-level element inside an inline element.
Secondly, clear: both; does nothing in this case, as you are not floating anything.
Here is what you are looking for (I think):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css" media="all">
#menu {
width:700px;
height: 25px;
background: #000;
text-align: center;
}
#menu ul {
margin: 0;
padding:0;
}
#menu ul li {
display: inline;
list-style: none;
padding: 2px 15px;
}
#menu ul li a {
color:#FFF;
}
</style>
</head>
<body>
<div id="menu">
<ul>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
<li><a href="#">link 4</a></li>
<li><a href="#">link 5</a></li>
<li><a href="#">link 6</a></li>
</ul>
</div>
</body>
</html>
Let me know if this is not what you are looking for.
|