Hajo Schuetz: zwei unterschiedliche Linkfarben festlegen

Hi NG,

die Darstellung der Links auf meiner Seite wird ueber eine css-datei geregelt.

a:link {color:#5994CF; text-decoration:none;}
a:hover {text-decoration:underline; font-weight:bold; color:#ff0000;}
a:visited {color:#cccccc; text-decoration:none;}
a:active { font-weight:bold; color:#0000ff; text-decoration:underline }
a:focus { font-weight:bold; color:#00E000; text-decoration:underline }

Nun muss ich auf der selben Seite in bestimmten Bereichen die Linkfarbe aendern, da sie sonst die Farbe des Hintergrundes haben und damit erstmal nicht sichtbar sind.

Danke fuer die Tipps im Voraus

Gruss Hajo

  1. Hallo,

    Du kannst eine Klasse definieren, welche einfach nur eine andere Linkfarbe hat.

    a:link {color:#5994CF; text-decoration:none;}
    a:hover {text-decoration:underline; font-weight:bold; color:#ff0000;}
    a:visited {color:#cccccc; text-decoration:none;}
    a:active { font-weight:bold; color:#0000ff; text-decoration:underline }
    a:focus { font-weight:bold; color:#00E000; text-decoration:underline }
    .anders {font-weight:bold; color:#ffffff; text-decoration:underline;}

    Aufruf dann mit <a class="anders" href="wasauchimmer.html">...

    Gruß

    Harald

    1. Hallo Harald,

      .anders {font-weight:bold; color:#ffffff; text-decoration:underline;}

      Aufruf dann mit <a class="anders" href="wasauchimmer.html">...

      danke fuer den Tipp ;-)
      werde ich gleich umsetzen.
      Gruss Hajo

  2. Hallo

    a:link {color:#5994CF; text-decoration:none;}
    a:hover {text-decoration:underline; font-weight:bold; color:#ff0000;}
    a:visited {color:#cccccc; text-decoration:none;}
    a:active { font-weight:bold; color:#0000ff; text-decoration:underline }
    a:focus { font-weight:bold; color:#00E000; text-decoration:underline }

    Nun muss ich auf der selben Seite in bestimmten Bereichen die Linkfarbe aendern, da sie sonst die Farbe des Hintergrundes haben und damit erstmal nicht sichtbar sind.

    Als ganzer neuer Satz:

    a.tuut:link {color:#FFFFFF; text-decoration:none;}
    a.tuut:hover {text-decoration:underline; font-weight:bold; color:#FFFF00;}
    a.tuut:visited {color:#cccccc; text-decoration:none;}
    a.tuut:active { font-weight:bold; color:#BBBBFF; text-decoration:underline }
    a.tuut:focus { font-weight:bold; color:#88EE88; text-decoration:underline }

    <a class="tuut" href.....

    Danke fuer die Tipps im Voraus

    Gruss Hajo