Previous Message
Next Message

Lists in menus and elsewhere on the same page

Sent by Ian Piper on 15 March 2006 19:07

Hi all,

I'm getting in a knot over list items. I am using one for a  
horizontal menu and that is working fine. However, I want also to  
have a regular unordered list on one of my pages and it is not working.

The menu ul and li styles are like this:

ul {
	border-top: 1px solid #000000;
	border-bottom: 1px solid #000000;
	margin: 5px 10px 20px 10px;
	padding: 5px 0;	
	list-style: none;
	display: inline;
	float: left;
	width: 740px;

ul a {
	display: block;
	width: 115px;
	height: 20px;
	margin-right: 5px;
	border: 1px solid #666666;
	font-family: Arial, Helvetica, san-serif;
	font-size: 14px;
	text-decoration: none;
	text-align: center;
	color: #000000;
	background-color: #ffffff;

ul a:hover {
	background-color: #e9e9e9;
	border-color: #ff0000;

ul li {
	float: left;

When it came to the "normal" list I thought I could do this:

..body ul {
	border: 0;
	list-style: disc;

..body li {
	display: block;
	color: #0000ff;

(the blue text is just so that I can follow changes - I'm not going  
to keep it like this!)

However, on the page the list items seem to be displaying inline and  
with borders top and bottom - i.e. like the menu list items. I tried  
enclosing the menu buttons in a <div> and then defining the menu  
button styles like this:

#mainNav ul {

but it seems to make no difference. In all, it is not working. You  
can see the page where it is all going wrong here: http://

Any guidance much appreciated.

Dr Ian M Piper
skype: ianmpiper
Where is the wisdom we have lost in knowledge?
Where is the knowledge we have lost in information?

css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Possibly related: