Fabian Transchel: float: left|right nur im Netscape 7 und Opera 6 richtig?

Beitrag lesen

Hallo Gunther,

html,body {height: 100%; width: 100%; margin: 0px; padding: 0px; background-color: #fff; color: #000;}
#div1  {width: 25%; background-color: #ccc; color: #000; margin: 0px; padding: 0px; float: left;}
#div2  {width: 75%; height: 300px; background-color: #999; color: #000; margin: 0px; padding: 0px;}

Hier ist alles richtig, so wie ich sehe.

<div id="div1">
Innerhalb von DIV-1
</div>
<div id="div2" style="">
Außerhalb von DIV-1,<br>
dafür aber innerhalb von DIV-2
</div>

Hier ist etwas falsch, du solltest die divs verschachteln, damit sie richtig floaten, denn so werden sie untereinander dargestellt.

Wenn du jedoch

<div id="div1">
Innerhalb von DIV-1
<div id="div2" style="">
Innerhalb von DIV-1,<br>
dafür aber auch innerhalb von DIV-2. Ich floate in div-1 herum.
</div>
</div>
schreibst, so funktioniert dein Floating.

Fabian