Prvý príklad ti obalí element menu do elementu header a element header sa obalý do elementu wrapper.
Kód:
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
#wrapper {
width: 980px;
background-color: #f00;
}
#header {
width: 600px;
height: 300px;
background-color: #0f0;
}
#menu {
width: 400px;
height: 100px;
background-color: #00f;
}
//-->
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="menu">
</div>
</div>
</div>
</body>
</html>
Druhý príklad ti všetky elementy zobrazí pod sebou:
Kód:
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
#wrapper {
width: 980px;
height: 20px;
background-color: #f00;
}
#header {
width: 600px;
height: 300px;
background-color: #0f0;
}
#menu {
width: 400px;
height: 100px;
background-color: #00f;
}
//-->
</style>
</head>
<body>
<div id="wrapper">
</div>
<div id="header">
</div>
<div id="menu">
</div>
</body>
</html>
Mimochodom v tvojom prvom kóde ti chýba </div> a v druhom máš jeden </div> navyše.