Ragnarök: onmouseover / onmouseout in CSS

Beitrag lesen

Hallo Zusammen,

ich habe eine Tabelle im html bei der die einzelnen <tr> bei onmouseover und onmouseout die Hintergrundfarbe wechseln.

Codeausschnitt:

<table width="100%" border="3" align="center" cellpadding="0" cellspacing="1">
  <tr onmouseover="this.bgColor='#708CA9';" onmouseout="this.bgColor='gold'" onclick="this.bgColor='blue'">
    <td>a</td>
    <td>b</td>
    <td>c</td>
  </tr>
  <tr onmouseover="this.bgColor='#708CA9';" onmouseout="this.bgColor='gold'" onclick="this.bgColor='blue'">
    <td>a</td>
    <td>b</td>
    <td>c</td>
  </tr>
</table>

Nun muss ich bei jedem <tr> die einzelnen Farben und Aktionen definieren.
Gibt es eine Möglichkeit dies ins CSS auszulagern?

Besten Dank

Grüsse Ragnarök