HTML Links, Farbe definieren

  • #1
V

VoiD

Bekanntes Mitglied
Themenersteller
Dabei seit
05.06.2002
Beiträge
155
Reaktionspunkte
0
Hi,

ich habe ein Problem beim Formatieren meiner Links:

im HTML-Head habe ich folgende Definition:

HTML:
<head>
<style type=text/css>
<!--
a:link { text-decoration:none; font-weight:normal; color:blue; }
a:visited { text-decoration:none; font-weight:normal; color:blue; }
a:hover { text-decoration:underline; font-weight:normal; color:red; }
a:active { text-decoration:none; font-weight:normal; color:yellow; }
-->
</style>  
</head>

Nun habe ich in meinem normalen Text, eine Passage, die in grauer Schrift (#606060) dargestellt wird. Dort habe ich auch einen Link, der auch in grauer Farbe erscheinen soll, der aber z.B. rot wird (a:hover) wenn man mit der Maus darüberfährt. Mit
HTML:
<body>
<a href=meinLink.htm style=color:#606060>Link Name</a>
geht es nicht, weil dann der Text immer grau dargestellt wird.

Wie/Was muss man ändern, damit es klappt?

Gruß
VoiD
 
  • #2
Eine Möglichkeit besteht darin, für diesen grauen Link ein eigenes Style zu definieren
Code:
<HTML>
<head>
<style type=text/css>
<!--
a:link { text-decoration:none; font-weight:normal; color:blue; }
a:visited { text-decoration:none; font-weight:normal; color:blue; }
a:hover { text-decoration:underline; font-weight:normal; color:red; }
a:active { text-decoration:none; font-weight:normal; color:yellow; }

a.grey:link { text-decoration:none; font-weight:normal; color:#606060; }
a.grey:visited { text-decoration:none; font-weight:normal; color:#606060; }
a.grey:hover { text-decoration:underline; font-weight:normal; color:red; }
a.grey:active { text-decoration:none; font-weight:normal; color:yellow; }
-->
</style>  
</head>
<body>
<a href=# class=grey>Link Name</a><br>
<a href=#>Link Name</a>
</body>
</HTML>
 
  • #3
werd ich auf alle Fälle mal ausprobieren.

Danke für den Tipp
 
  • #4
Hey, hat so funktioniert, wie ich es gern hätte.

Viiieeellleeeen Daaaannnkk :)


PS: du sprichst von einer Möglichkeit - gibt es auch noch eine andere?
 
Thema:

HTML Links, Farbe definieren

ANGEBOTE & SPONSOREN

Statistik des Forums

Themen
113.838
Beiträge
707.959
Mitglieder
51.491
Neuestes Mitglied
haraldmuc
Oben