Stefan: margin + leere Divs Problem beim FireFox

HAllo,

folgendes Script wird beim IE richtig angezeigt aber im FF falsch, weil das grüne DIV dürfte nach oben keinen Rand haben.

Sobald ich margin im Inneren entferne, oder z.B. durch Padding ersetzte dann klappts überall, aber wie mache ichs, das es auch mit margin klappt.

Vielen Dank für Eure Hilfe, bin echt schon fast am Verzweifeln.

Im Anschluss das komplette Script:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">

*, html, body {
 width:100%;
 height:100%;
 margin:0;
 padding:0;
}

html > body #container {
 min-height:100%;
 height:auto;
}

#aussen {
float:none;
margin:0 auto 0 auto;
width:500px;
height:1000px;
background-color:green;
}

#innen {
margin-top:50px;
float:none;
width:300px;
height:100px;
background-color:yellow;
}
</style>
</head>

<body>
<div id="aussen">
 <div id="innen"></div>
</div>
</body>
</html>

  1. hi,

    folgendes Script

    Welches Script?
    Das ist ein HTML-Dokument mit eingebettetem CSS.

    wird beim IE richtig angezeigt aber im FF falsch,

    <wieueblich> Nein, genau andersherum. </wieueblich>

    weil das grüne DIV dürfte nach oben keinen Rand haben.

    Stimmt, es "darf" nicht - es _muss_.

    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."

    gruß,
    wahsaga

    --
    /voodoo.css:
    #GeorgeWBush { position:absolute; bottom:-6ft; }