Ich habe das Problem, dass ich es einfach nicht schaffe, das eine Liste über ein z-index in den Vordergrund zu rücken. Der gekürzte html-Code ist
<!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">
<head>
<title>Titel</title>
<link rel="stylesheet" href="stylesheets/style.css" media="screen" type="text/css" />
</head>
<body>
<div id="body">
<div id="Rahmen">
<ul id="Navigation">
<li id="menueins">
<a href="anfang.php" class="liste">Zum Anfang</a>
<ul>
<li><a href="dings.php">link</a></li>
</ul>
</li>
<li id="menuzwei">
<a href="praktisches.php" class="liste">Praktisches</a>
<ul>
<li><a href="dingszwei.php">Link</a></li>
</ul>
</li>
</ul>
<div id="inhalt">
Lorem ipsum...
</div>
</div>
</div>
</body>
</html>
Die gekürzte CSS-Datei ist, es geht um die Klasse menueins. Das fixed ist nur ein Beispiel, absolute und relative habe ich auch schon getestet.
ul#Navigation {
margin: auto;
z-index: 3;
}
ul#Navigation li {
position: relative;
z-index: 4;
}
ul#Navigation li ul {
z-index: 2;
position: absolute;
display: none;
}
ul#Navigation li ul li a {
z-index: 1000;
}
ul#Navigation li:hover ul {
display: block;
}
li#menueins {
background-color: pink;
/*Farbe testweise, um diesen Teil geht es*/
position: fixed;
z-index: 2000;
}
ul#Navigation li ul li {
left: 0em;
float: none;
display: block;
}
ul#Navigation a {
display: block;
}
#inhalt {
position: relative;
z-index: 1;
}
Wer weiß, woran das liegt? Wenn ich das z-index (wie in der zweiten Liste) direkt formatiere wird es übernommen... Würde mich freuen, wenn jemand weiterweiß.
Falls die Kurversion keine Hinweise bietet, gibt es den gesamten Quelltext + CSS unter http://www.opera-tutorial.de/
Gruß Das Ende