Beim Internet Explorer 8 und 9 ist ein div unter dem header. Bei IE 7,6 und 5.5 und auch bei allen anderen modernen Browsern ist der header vor dem anderen div so wie ich das eigentlich wollte. Ich habe noch zwei Screenshots gemacht im IE7 so wie es sein soll und im IE9 so wie es nicht sein soll.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>Home</title>
<style type="text/css">
textarea{
font-family:"Verdana",sans-serif;
}
*{
margin:0px;
}
a:visited{
color:blue;
}
body{
margin:0;
background:#BEE1E8;
color:#00233B;
font-family:"Verdana",sans-serif;
}
#head{
min-width:950px;
background: #207cca; /* Old browsers */
background: -moz-linear-gradient(top, #207cca 0%, #609ac9 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#207cca), color-stop(100%,#609ac9)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #207cca 0%,#609ac9 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #207cca 0%,#609ac9 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #207cca 0%,#609ac9 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#207cca', endColorstr='#609ac9',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #207cca 0%,#609ac9 100%); /* W3C */
height:100px;
left:0;
border-bottom:3px solid #1E5799;
}
#sidebar{
margin:10px 0px 0px 10px;
width:220px;
height:600px;
background:rgb(255,255,255);
background:rgba(255,255,255,0.7);
float:left;
}
#main,#sidebar{
-moz-border-radius:5px;
border-radius:5px;
}
#main{
-moz-border-radius-topleft:0px;
border-top-left-radius:0px;
margin:-40px 10px 10px 250px;
background:rgb(255,255,255);
background:rgba(255,255,255,0.7);
width:700px;
height:800px;
}
#nav{
position:absolute;
margin-top:-28px;
min-width:700px;
}
#nav div a{
padding-top:3px;
text-decoration:none;
display:block;
color:#00233B;
}
#nav div{
-moz-border-radius-topleft:4px;
-moz-border-radius-topright:4px;
border-top-left-radius:4px;
border-top-right-radius:4px;
float:left;
text-align:center;
margin:0 2px;
padding:0 7px;
height:28px;
font-size:110%;
background:rgb(255,255,255);
background:rgba(255,255,255,0.3);
-moz-transition: background 0.3s;
-webkit-transition: height 0.3s;
-o-transition: height 0.3s;
transition: height 0.3s;
}
#tab1{
margin-left:0px!important;
}
.navtarg{
cursor:default;
background:rgb(255,255,255);
background:rgba(255,255,255,0.7)!important;
}
.subnav{
clear:both;
position:absolute;
width:500px;
height:37px;
}
.subnav a{
display:table-cell;
vertical-align:middle;
color:#00233B!important;
font-size:80%;
text-decoration:none;
padding:0px 14px;
height:38px;
}
#subnav2,#subnav3,#subnav4,#subnav5{
display:none;
}
.flol{
float:left;
}
.flor{
float:right;
}
</style>
</head>
<body>
<div id="head">
</div>
<div id="sidebar">
</div>
<div id="main">
<div id="nav">
<div class="navtarg" id="tab1"><a href="#">Home</a></div>
<div id="tab2"><a href="#">testseite</a></div>
<div id="tab3"><a href="#">Nachrichten</a></div>
<div id="tab4"><a href="#">irgendetwas</a></div>
<div id="tab5"><a href="#">Test</a></div>
</div>
<div class="subnav" id="subnav1">
<a href="#">Seite 1</a>
<a href="#">Unterseite 2</a>
<a href="#">BlaBla</a>
<a href="#">Test</a>
</div>
<div class="subnav" id="subnav2">
<a href="#">Seite 2.1</a>
<a href="#">Unterseite 2.2</a>
<a href="#">BlaBla 2.3</a>
<a href="#">Test 2.4</a>
</div>
<div class="subnav" id="subnav3">
<a href="#">Seite 3.1</a>
<a href="#">Unterseite 3.2</a>
<a href="#">BlaBla3.3</a>
<a href="#">Test3.4</a>
</div>
<div class="subnav" id="subnav4">
<a href="#">Seite 4.1</a>
<a href="#">Unterseite 4.2</a>
<a href="#">BlaBla 4.3</a>
<a href="#">Test 4.4</a>
</div>
<div class="subnav" id="subnav5">
<a href="#">Seite 5.1</a>
<a href="#">Unterseite 5.2</a>
<a href="#">BlaBla 5.3</a>
<a href="#">Test 5.4</a>
</div>
</div>
</body>
</html>
Warum geht es nicht richtig im IE 8 und 9? Ich habe es schon mit z-index ausprobiert, aber es ändert nichts.