Supportnet Computer
Planet of Tech

Supportnet / Forum / Webseiten/HTML

CSS - Mouseover - unterstreichen





Frage

hi, ich bin anfänger betreffend css. möchte aber mit css den text (navigation) in einer tabelle bei mouseover unterstreichen und mit einer anderen farbe zuweisen. wenn möglich nicht im html eingebunden. bitte um ausführliche hilfe - da greenhorn betreffend css. funkt dies auch bei netscape??? danke

Antwort 1 von Saiya-jin

Hi!
Also du hast ja ne css datei die eventuel so ausieht:


.bla {
       font-size: 9pt;
       font-weight: bold;
       text-decoration: none;
       color: #054FC9;
      }


da drunter legst du dann etwas in der art an:


.bla:hover {
       font-size: 9pt;
       font-weight: bold;
       text-decoration: underline ;
       color: #054FC9;
      }


Du musst also einfach nur ein :hover hinter deine class setzen. Die geht auch mit:

  1. visited für schonmal besuchte Links
  2. hover für Hover Effekte
  3. active für aktive(gerade geklickte) Links


Wenns zu schwer war tu folgendes:

Lad dir am besten dieses
Beispiel
runter und lerne durch zugucken oder guck bei
SelfHTML
und brings dir selber bei.

Hoffe ich konnte helfen
Michael

Antwort 2 von semi

Hier ein Beispiel mit Javascript und CSS.

<html>
<head>
<style type="text/css">
a {
    text-decoration:none;
    color:#ffffff;
    padding:2px 4px;
    border:1px solid #000080;
  }
</style>
<script type="text/javascript">
function hover(ctrl,onoff) {
  ctrl.style.borderColor=((onoff)?"#ffffff":"#000080");
  ctrl.style.color=((onoff)?"f8f800":"#ffffff");

  //ctrl.style.backgroundColor=((onoff)?"#ffffff":"#000080");
  //ctrl.style.color=((onoff)?"#000080":"#ffffff");
}
</script>
</head>
<body bgColor="navy">
<a href="Javascript:alert('Autsch!');"
	onmouseover="hover(this,1);"
	onmouseout="hover(this,0);">
Bloß nicht anklicken!</a><br><br>
<a href="Javascript:alert('Festplatte formatiert!');"
	onmouseover="hover(this,1);"
	onmouseout="hover(this,0);">
Hier schon gar nicht!</a>
</body>
</html>

Gruß,
Michael

Ich möchte kostenlos eine Frage an die Mitglieder stellen:


Ähnliche Themen:


Suche in allen vorhandenen Beiträgen: