• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Link Farbe ändern

prinz habibi

Neues Mitglied
hallo! ich bin noch nicht wirklich mit css vertraut habe eine kleine Frage wie kann ich den link auf der seite der ich mich befinde die farbe in meiner navileiste ändern.. habe hier meine css datei.. vielen dank im voraus.

#hauptnavigation {
width: 13em;
background-color: #DFE1F0;
border: 1px solid #A9B0D7;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #2E3192;
font-size: 0.8em;
}

#hauptnavigation ul, #hauptnavigation ul li {
padding: 0;
margin: 0;
list-style: none;
}

#hauptnavigation a {
text-decoration: none;
display: block;
color: #2E3192;
}

* html #hauptnavigation a {
width: 100%;
}

#hauptnavigation ul li {
font-weight: bold;
border-bottom: 4px solid #A9B0D7;
}

* html #hauptnavigation ul li {
height: 1em;
}

#hauptnavigation ul li a {
padding: 6px;
}

#hauptnavigation ul li ul li {
font-weight: normal;
border-top: 1px solid #A9B0D7;
border-bottom: 0 solid #A9B0D7;
}

#hauptnavigation ul li ul li a {
padding: 6px 14px;
}

#hauptNavigation a {
text-decoration: none;
display: block;
color: #2E3192;
 
Hallo,

wenn du deine Seite statisch aufgebaut hast, musst du dem Link in deiner Navigation, auf deren Seite sich die Navi befindet, eine spezielle Klasse oder ID zuweisen und dort im CSS umschreiben. Wenn du die Seite dynamisch gestaltet hast (evtl. eine Lösung über include() mit $_GET) kannst du beim Aufruf des Menüs prüfen, welche Seite aktiv ist und dort ebenfalls eine entsprechende Klasse / ID setzen.
 
und wenn du eine background Hover möchtest dann hier

Code:
#hauptnavigation a:hover {
text-decoration: none;
display: block;
color: #[U][B]Hier deine Farbe[/B][/U];
background:#[U][B]DEINE FARBE[/B][/U];
}
 
Zurück
Oben