Abstand oben bei float:left u. right im FF1.03. Bug?
Aybee
- css
0 wahsaga
Hallo,
schaut euch doch bitte mal untenstehenden Code an, oder besser, kopiert ihn in euren Browser. 3 Div-Elemente stehen im Code untereinander, der 1. mit der Eigenschaft float:left.
Problem: Der FF1.03 addiert die Eigenschaft "margin:top" des 2. "divs" zu der Eigenschaft "margin:top" des 1. "divs". Seltsamerweise korrigiert er das, sobald dem "body" ein Rahmen von min. 1px zugewiesen wird (einfach Kommentar entfernen).
Mach ich was falsch, oder ist das ein Bug.
ps. den 3px Bug im IE5.5 krieg ich hier auch nicht weg, hab schon mit Anleitung probiert. Wenn das auch noch jemand hinbekommen würde?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Abstand oben bei float:left u. right im FF1.03</title>
<style type="text/css">
<!--
/*body { border:solid 1px; }*/
body { padding:0; margin:0; }
div { width:100px; height:100px; }
#menue { margin:300px 0 0 100px; display:inline; /*doublemarginhack*/ float:left; background:#FFECD0; }
#header { margin:110px 0 0 290px; background:#FFDCA8; }
#inhalt { margin-left:200px; background:#FFD488; }
-->
</style>
</head>
<body>
<div id="menue">div 1<br>float:left<br>links 100px<br>oben 300px
</div>
<div id="header">div 2<br>links 290px<br>oben 110px
</div>
<div id="inhalt">div 3<br>links 200px<br>oben 0px
</div>
</body>
</html>
Gruß von Aybee
hi,
Problem: Der FF1.03 addiert die Eigenschaft "margin:top" des 2. "divs" zu der Eigenschaft "margin:top" des 1. "divs".
nein, kein problem.
http://www.w3.org/TR/CSS21/box.html#collapsing-margins:
"The top margin of an in-flow block-level element is adjoining to its first in-flow block-level child's top margin if the element has no top border, no top padding, and the child has no clearance."
Seltsamerweise korrigiert er das, sobald dem "body" ein Rahmen von min. 1px zugewiesen wird (einfach Kommentar entfernen).
auch nicht seltsam.
siehe oben.
gruß,
wahsaga