Hallo,
Das Problem was ich hierbei habe zeig ich euch anhand meiner CSS und meiner Liste:
HTML
<div id="navigation">
<ul>
<li><a href="#" class="link1">Home</a></li>
<li><a href="#" class="drop link2">Aktuelles </a> </li>
<li><a href="#" class="drop link3">Irgendwas</a>
<ul>
<li><a href="#">Standort Frankfurt</a></li>
<li><a href="#">Standort Muenchen</a></li>
</ul>
</li>
<li><a href="#" class="drop link4">Schwerpunkt</a></li>
</ul>
</div>
Alles anzeigen
Meine CSS sieht wie folgt aus:
HTML
/* float the list to make it horizontal and a relative positon so that you
can control the dropdown menu positon */
#navigation li {
width:216px;
position:relative;
}
/* style the links for the top level */
#navigation a, #navigation a:visited {
display:block;
height:40px;
background:url(./images/navigation.png) top left;
text-indent:-9000px;
}
/* a hack so that IE5.5 faulty box model is corrected */
* html #navigation a, * html #navigation a:visited {
width:216px;
width:216px;
}
/* style the second level background */
#navigation ul ul a.drop, #navigation ul ul a.drop:visited {
background:#103b7d;
}
/* style the second level hover */
#navigation ul ul a.drop:hover{
background:#fff;
color:#103b7d;
}
#navigation ul ul :hover > a.drop {
background:#fff;
color:#103b7d;
}
/* style the third level background */
#navigation ul ul ul a, #navigation ul ul ul a:visited {
background:#e2dfa8;
}
/* style the third level hover */
#navigation ul ul ul a:hover {
background:#103b7d;
}
/* hide the sub levels and give them a positon absolute so that they take up no room */
#navigation ul ul {
visibility:hidden;
position:absolute;
top:-10px; left:216px;
padding:4px;
background:#103b7d;
height:96px; width:216px;
border-left:1px solid #999;
}
/* another hack for IE5.5 */
* html #navigation ul ul {
top:-9px;
top:-10px;
}
/* position the third level flyout menu */
#navigation ul ul ul{
left:149px;
top:-1px;
width:145px;
}
/* position the third level flyout menu for a left flyout */
#navigation ul ul ul.left {
left:-145px;
}
/* style the table so that it takes no ppart in the layout - required for IE to work */
#navigation table {
position:absolute;
top:0;
left:0;
border-collapse:collapse;
}
/* style the second level links */
#navigation ul ul a, #navigation ul ul a:visited {
background:#103b7d;
color:#fff;
height:auto;
line-height:14px;
text-indent:0px;
display:block;
padding:5px;
text-decoration:none;
font-size:11px;
}
/* yet another hack for IE5.5 */
* html #navigation ul ul a, * html #navigation ul ul a:visited {
width:145px;width:145px;
}
/* style the top level hover */
#navigation :hover > a, #navigation ul ul :hover > a {
background:url(./images/navigation.png) top left;
}
/* top level image background placements */
#navigation a.link1:hover {background-position:-216px 0px;}
#navigation a.link2 {background-position:0px -40px;}
/* DO NOT consolodate next 2 lines into one, this breaks IE6 */
#navigation a.link2:hover {background-position:-216px -40px;}
#navigation :hover > a.link2, #navigation ul ul :hover > a.link2 {
background-position:-216px -40px;}
#navigation a.link3 {background-position:0px -80px;}
#navigation a.link3:hover{background-position:-216px -80px;}
#navigation :hover > a.link3, #navigation ul ul :hover > a.link3 {
background-position:-216px -80px;}
#navigation a.link4 {background-position:0px -120px;}
#navigation a.link4:hover {background-position:-216px -120px;}
#navigation :hover > a.link4, #navigation ul ul :hover > a.link4 {
background-position:-216px -120px;}
#navigation a.link5 {background-position:0px -160px;}
#navigation a.link5:hover {background-position:-216px -160px;}
#navigation a.link6 {background-position:0px -200px;}
#navigation a.link6:hover {background-position:-216px -200px;}
#navigation ul ul a:hover {background:#fff; color:#103b7d;}
/* make the second level visible when hover on first level list OR link */
#navigation ul li:hover ul,
#navigation ul a:hover ul{visibility:visible; }
/* keep the third level hidden when you hover on first level list OR link */
#navigation ul :hover ul ul{visibility:hidden;}
/* make the third level visible when you hover over second level list OR link */
#navigation ul :hover ul :hover ul{ visibility:visible;}
Alles anzeigen
Dieses Navigationsmenü will ich nun mit Wordpress nachbauen. Dabei habe ich ein Bild erstellt, welches alle das vorher und hover in einem abgebildet hat.
Wie kann ich nun die Ausgabe machen wie
<ul class="link1"> .... <ul class="link2"> etc.
Ich zerbrech mir hier den Kopf finde aber keine Möglichkeit die wp_list_pages diese Informationen weiterzugeben, dass für jedes UL ein element class="link x" möglich ist!
Irgendein Tip?
Merci!