Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z hoverem w css
Kiubus
post
Post #1





Grupa: Zarejestrowani
Postów: 34
Pomógł: 0
Dołączył: 11.10.2010

Ostrzeżenie: (0%)
-----


Witam.
Mam taki oto kod CSS:
Cytat
a:link { color: aqua; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
a:visited { color: aqua; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
a:hover { color: red; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
a:active { color: red; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }

Wszystko fajnie, pięknie bo kolor tekstu linków w Menu jest biały a po najechaniu robi się czerwony. Chciałbym zrobić tak, że aktualna podstrona jest podświetlana na czerwono, a gdy na nią najedziemy to jest koloru białego. Czyli np. jestem na stronie głównej, to w menu pozycja "Strona Główna" jest czerwona a po najechaniu na nią kursorem jest biała. Pozostałe pozycje są białe i robią się czerwone tylko w momencie najechania na nie kursorem. Może mi ktoś pomóc? Próbowałem robić divem i w CSS do nazwy diva przypisać hovera zmodyfikowanego na kolor biały ale to nic niestety nie pomogło.
Pozdrawiam!
Go to the top of the page
+Quote Post
mar1aczi
post
Post #2





Grupa: Zarejestrowani
Postów: 731
Pomógł: 141
Dołączył: 9.05.2011
Skąd: śląskie

Ostrzeżenie: (0%)
-----


Dodaj dla aktywnej strony odpowiednią klasę dla "a" i ostyluj.
Go to the top of the page
+Quote Post
Kiubus
post
Post #3





Grupa: Zarejestrowani
Postów: 34
Pomógł: 0
Dołączył: 11.10.2010

Ostrzeżenie: (0%)
-----


mógłbyś zapodać jakiś przykład? Bo w kontekście CSS jestem kompletnie zielony :/
Go to the top of the page
+Quote Post
mar1aczi
post
Post #4





Grupa: Zarejestrowani
Postów: 731
Pomógł: 141
Dołączył: 9.05.2011
Skąd: śląskie

Ostrzeżenie: (0%)
-----


  1. <div id="menu">
  2. <a class="active">Strona główna</a>
  3. <a>podstrona</a>
  4. </div>

  1. #menu {
  2. background-color: grey;
  3. }
  4. a:link { color: aqua; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
  5. a:visited { color: aqua; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
  6. a:hover { color: red; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
  7. a:active { color: red; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold }
  8. a.active {color: red; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold}
  9. a.active:hover {color: white; text-decoration: none; font-size: large; font-family: Arial, Verdana; font-weight: bold}
Go to the top of the page
+Quote Post
Kiubus
post
Post #5





Grupa: Zarejestrowani
Postów: 34
Pomógł: 0
Dołączył: 11.10.2010

Ostrzeżenie: (0%)
-----


wielkie dzięki kolego!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 04:37