Problem with CSS floating elements

Miscellaneous Forums/General Discussion/Problem with CSS floating elements

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

floaters always give me jip.. and i also find ie actually does display things as I expect them to more often then the other browsers.

for example

<html>
<head>
</head>
<body>
	<div style="background-color:blue">
		<div>
			<div style="float:left;width=50%; background-color:red">left header</div>
			<div style="float:left;width=50%; background-color:green">right header</div>
		</div>
		<div style="background-color:yellow">main body</div>
	</div>
</body>


its a quick hack and the styling is embedded but from this quick test I would expect to see a red block in the left half, a green block in the right half and a full width yelow block underneath them.
Thats what ie shows.. but firefox shows all three blocks on 1 line.

Im sure its the way Im using the DIV's but I spent ages learning stylesheets using just ie and now I find my understanding is all wrong and I dont have any enthusiasm left to learn how it should be done.