Thread: Code Cleanup
View Single Post
12-18-2004, 04:06 AM
#12
ULTiMATE is offline ULTiMATE
Status: Member
Join date: Aug 2004
Location: Bristol, United Kingdom
Expertise:
Software:
 
Posts: 241
iTrader: 0 / 0%
 

ULTiMATE is on a distinguished road

Send a message via ICQ to ULTiMATE Send a message via AIM to ULTiMATE Send a message via MSN to ULTiMATE

  Old

Originally Posted by lightofmind
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.

Changed the code, but now i'm having the same problem of the background colour not changing, and the rest of the content below not moving down. I was thinking it might be because of my existing code in my stylesheet.