KrosseKrabbe: float: left; bringt Hintergrund um die Ecke

Beitrag lesen

Hallo,

folgendes Codefragment bringt mich um den Verstand...
#body umschließt #body_contents, daher sollten doch alle Angaben von #body auf #body_contents übertragen werden...
Warum "überschreibt" die float-Angabe in #body_contents die background-color-Angabe in #body?

Mit anderen Worten: ich brauche sowohl die FLOAT-Angabe als auch die Hintergrundfarbe
(die Hintergrundfarbe allerdings in #body und NICHT in #body_contents, da #body noch andere Inhalte beherbergt..);

  • wie kombiniere ich beide miteinander?!
  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title></title>  
<style type="text/css">  
<!--  
#body {  
	background-color: #FF0000;  
	width: 1200px;  
	margin: 0 0 0 0;  
	border: 0px;  
}  
  
#body_contents {  
	width: 711px;  
	padding: 20px 20px 20px 20px;  
	float: left;  
}  
-->  
</style></head>  
  
<body>  
<div id="body">  
<div id="body_contents">  
<p>Dieser Hintergrund sollte rot sein...</p>  
</div>  
</div>  
</body>  
</html>