Simple (noob) HTML/CSS question

Associate
Joined
11 Jun 2009
Posts
1,249
Been messing around with HTML/CSS, and I'm having problems.
Basically, I'm trying to make a horizontal menu bar. No problem there. Now, when I try to change the background colour of the menu to #333, nothing happens.

HTML:
Code:
<div id="navigationbar">
	<ul>
		<li><a href="/index.php">Home</a></li>
		<li><a href="/practise/practise.php">Practise pages</a></li>		
		<li><a href="/old/index.php">Old stuff</a></li>
	</ul>
</div>
CSS:
Code:
#navigationbar {
	background: #333;
	width: 100%;
	margin: 0;
	padding: 0;
}

#navigationbar ul {
	list-style: none;
	padding: 0;
}

#navigationbar li {
	float:left;
}

#navigationbar a {
	display: block;
	padding: 8px 12px;
}

I take it I'm missing something silly, but I can't see what :(
 
Thanks, that makes sense now!
I'll get rid of the containing div too, not sure why I'm using that.

I think I need to re-read a CSS tutorial though :P
Page layout with floats seems to be a bit harder than I thought.
 
Back
Top Bottom