Mouse-over-Effekt in externer CSS-Datei

  • Hallo,
    ich möchte gerne einen Mouse-over-Effekt für meine Navigation mit css erzeugen.
    Dumme Frage dazu vorweg: muss ich dafür zwingend das a-Tag verwenden, oder kann ich auch ein anderes z.B. <div> nehmen?

    Aber meine eigentliche Frage: wie setzte ich das Beispiel unten in einer externen Datei um? Wie stricke ich die Syntax in der css-Datei entsprechend um?

    <html><head><title>:link, :visited, :hover, :active</title>
    <style type="text/css">
    a:link { font-weight:bold; color:#0000E0; text-decoration:none }
    a:visited { font-weight:bold; color:#000080; text-decoration:none }
    a:hover { font-weight:bold; color:#E00000; text-decoration:none }
    a:active { font-weight:bold; color:#E00000; text-decoration:underline }
    a:focus { font-weight:bold; color:#00E000; text-decoration:underline }
    </style>
    </head><body bgcolor="FFFFFF" text="#000000">

    <h1>Bekannte Suchdienste</h1>


    Yahoo (Verzeichnis)

    Google (Suchmaschine)

    Web.de (Verzeichnis)

    </p>

    </body></html>

    Vielen lieben Dank im Voraus, Dee

  • du schreibst

    Code
    a:link { font-weight:bold; color:#0000E0; text-decoration:none }
    a:visited { font-weight:bold; color:#000080; text-decoration:none }
    a:hover { font-weight:bold; color:#E00000; text-decoration:none }
    a:active { font-weight:bold; color:#E00000; text-decoration:underline }
    a:focus { font-weight:bold; color:#00E000; text-decoration:underline }

    in eine "style.css" !

    dann gehst du in deine datei wo du die hin haben willst und fügst oben diesen code ein :

    Code
    <link rel="stylesheet" type="text/css" href="style.css">


    Gruß crazwulf :D