Hallo,
ich möchte für mein Main Menü in meinem WP-Theme die CSS-Werte für a:focus und a:active bestimmen. In meiner CSS Datei habe ich die Navigation mit der id "navi" bestimmt und darüber sämtliche Werte für a, a:active, a:hover und a:focus bestimmt.
Als reine HTML-Version funktioniert das auch einwandfrei. Nur sobald ich es in mein Theme integriere nicht mehr. Ich habe gesehen, dass WP das Menü nochmals in ein DIV mit class="menu" packt.
Leider kann ich ja über die Klasse nicht die Werte der darin liegenden Elemente bestimmern, wie bspw. bei einer id (#navi a:hover in meinem Fall).
Gibt es da irgendeinen Weg, das doch noch irgendwie hinzukriegen. Denn meine Werte für :hover übernimmt auch die Klasse von der übergeordneten id.
Mein CSS-Code:
#navi {padding: 0;
list-style-type: none;
position: relative;
}
#navi li {float: left;}
#navi a {float: left;
position: relative;
margin: 0px 20px 0px 0px;
font-family: Arial, sans-serif;
font-size: 24px;
font-weight: bold;
text-decoration: none;
height: 40px;
display: block;
text-align: center;
line-height: 40px;
border: none;
color: #111111;
text-shadow: 1px 1px 0px rgba(255,255,255,0.3);}
#navi a:hover, #navi a:active, #navi a:focus {color: #da0615;
text-shadow: none;
text-shadow: 1px 1px 0px rgba(255,255,255,0.5);}
Alles anzeigen
Und hier das HTML, das WP generiert:
<div id="navi">
<div class="menu">
<ul>
<li class="page_item page-item-6"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/"]http://localhost/jung/[/URL]">Home</a></li>
<li class="page_item page-item-8 current_page_item"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=8"]http://localhost/jung/?page_id=8[/URL]">News</a></li>
<li class="page_item page-item-10"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=10"]http://localhost/jung/?page_id=10[/URL]">Produkte</a></li>
<li class="page_item page-item-12"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=12"]http://localhost/jung/?page_id=12[/URL]">Service</a></li>
<li class="page_item page-item-14"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=14"]http://localhost/jung/?page_id=14[/URL]">Galerie</a></li>
<li class="page_item page-item-16"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=16"]http://localhost/jung/?page_id=16[/URL]">Über uns</a></li>
<li class="page_item page-item-18"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=18"]http://localhost/jung/?page_id=18[/URL]">Kontakt</a></li>
<li class="page_item page-item-20"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=20"]http://localhost/jung/?page_id=20[/URL]">Karriere</a></li>
<li class="page_item page-item-22"><a href="[URL="http://forum.wpde.org/view-source:http://localhost/jung/?page_id=22"]http://localhost/jung/?page_id=22[/URL]">FAQ</a></li>
</ul>
</div>
</div>
Alles anzeigen
Es wäre schade, wenn man die Werte nicht übergeben könnte, vor allem, weil :hover auch noch übernommen wird.
Es wäre schön, wenn mir jemand einen Tipp oder einen Lösungsansatz nennen könnte.
Besten Dank im Voraus.