WebWork Magazin - Webseiten erstellen lassen, Online Medien, html

Webhoster, Webhosting Provider und Domain registrieren

Home | Registrieren | Einloggen | Suchen | Aktuelles | GSL-Webservice | Suleitec Webhosting
Reparatur-Forum | Elektro forum | Ersatzteilshop Haushalt und Elektronik


Homepage und Webhosting-Forum

HTML, XHTML, CSS , style, XML, Javascript und mehr, Fragen, Tipps und Anregungen zu diesen Basic Techniken - hier rein !


Forum » HTML, CSS - Hilfe für das Erstellen einer Homepage » [gelöst] Farbwechsel vom Link bei onMouseover » Antworten
Benutzername:
Passwort: Passwort vergessen?
Inhalt der Nachricht: Fett | Kursiv | Unterstrichen | Link | Bild | Smiley | Zitat | Zentriert | Quellcode| Kleiner Text
Optionen: Emailbenachrichtigung bei Antworten
 

Die letzten 5 Postings in diesem Thema » Alle anzeigen
von Flash
Solche Sachen sind für mich Böhmishce Dörfer ^^
von Christian_DCP
Jawoll ja, es funzt; nochmals danke.
von Christian_DCP
Danke für die Antwort; werde ich nachher mal testen und dich wissen lassen, ob es funzt.

Gruß

Chris
von Tobi W.
Hallo,

mit
1: 
2: 
3: 
4: 
5: 
6: 
7:
<style type="text/css">
a:link { font-weight:bold; color:#CFCFCF; text-decoration:none }
a:visited { font-weight:bold; color:#CFCFCF; text-decoration:none }
a:hover { font-weight:bold; color:#FFFFFF; text-decoration:none }
a:active { font-weight:bold; color:#FFFFFF; text-decoration:underline }
a:focus { font-weight:bold; color:#00E000; text-decoration:underline }
</style>


bestimmst Du die Farbe von jedem Link auf Deiner Seite der keine Class hat.
Mach es mal so (beisp.):

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12:
<style type="text/css">
a:link { font-weight:bold; color:#CFCFCF; text-decoration:none }
a:visited { font-weight:bold; color:#CFCFCF; text-decoration:none }
a:hover { font-weight:bold; color:#FFFFFF; text-decoration:none }
a:active { font-weight:bold; color:#FFFFFF; text-decoration:underline }
a:focus { font-weight:bold; color:#00E000; text-decoration:underline }
a.link2:link { font-weight:bold; color:#FFFFFF; text-decoration:none }
a.link2:visited { font-weight:bold; color:#CFCFCF; text-decoration:none }
a.link2:hover { font-weight:bold; color:#CFCFCF; text-decoration:none }
a.link2:active { font-weight:bold; color:#FFFFFF; text-decoration:underline }
a.link2:focus { font-weight:bold; color:#00E000; text-decoration:underline }
</style>

und dann im html den entsprechenden Link
1:
<a href="link.php" class="link2">Link</a>


Müßte dann klappen

Gruß


EDIT:
Ach ja, die Antwort auf Deine Frage:
Den Farbwechsel der Textfarbe kannst du mit
1:
this.style.color='#FFFFFF'

ändern.
von Christian_DCP
Hallo miteinander,

es ist evtl. eine doofe Frage; sie ist auch wahrscheinlich leicht zu beantworten, für jemanden der sich mit der Materie gut auskennt, sie wurde evtl. auch schon öfters gestellt, aber ich muss sie doch stellen

Ich habe folgendes Problem:
Ich möchte in eine HP bei den Links einen Farbwechsel, der durch onmouseover erzeugt wird. Mit CSS wie unten beschrieben bringt mir das nix, weil ich zwei verschiedene Farben auf der Seite brauche, wegen zwei verschiedenen Backgrounds (arbeite mit table).
1: 
2: 
3: 
4: 
5: 
6: 
7:
<style type="text/css">
a:link { font-weight:bold; color:#CFCFCF; text-decoration:none }
a:visited { font-weight:bold; color:#CFCFCF; text-decoration:none }
a:hover { font-weight:bold; color:#FFFFFF; text-decoration:none }
a:active { font-weight:bold; color:#FFFFFF; text-decoration:underline }
a:focus { font-weight:bold; color:#00E000; text-decoration:underline }
</style>

Evtl. kann man ja auch den CSS Quelltext erweitern, so dass man zwei verschiedene a:hovers macht; ich weiss nur net wie.

Ich bin auf meiner Suche durch die weiten welten des inets nur auf folgenden Quelltext gekommen, um das mit onmouseover zu erreichen:
<a href="index.html" onMouseover="this.style.backgroundColor='#FFFFFF'" onMouseout="this.style.backgroundColor=''">
*Home</a>
Aber ich möchte ja nicht den Background sondern die Linkfarbe wechseln.
Kann mir einer sagen, was ich anstatt "this.style.backgroundColor... schreiben muss?

Wäre echt super, Danke im Vorraus.

Gruß

Chris

Nach oben