Announcement

Collapse
No announcement yet.

simpler Hover

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • simpler Hover

    Hallo ich möchte einen Simplen Hover machen aber es klappt nicht.
    Ziel ist es einfach die Zeile farblich hervor zu heben auf dem gerade die Maus steht.

    HTML Code:
    <style type="text/css">
    #beispieltabelle tbody tr:hover {
        background: yellow;
        color: black;
    }
    </style>
    
    <table id="beispieltabelle" border="1">
    <thead>
        <tr>
            <th>Nr.</th>
            <th>K&uuml;rzel</th>
            <th>Beschreibung</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1.</td>
            <td>Pro2</td>
            <td>Fahren Sie mit der Maus auf diese Tabelle, um den Effekt zu sehen!</td>
        </tr>
    
        <tr>
            <td>2.</td>
            <td>Bsp1</td>
            <td>hier kommt nun viel Beispieltext f&uuml;r die Tabelle</td>
        </tr>
    
    </tbody>
    
    </table>
    ist doch alles richtig oder?

  • #2
    Funktioniert ja auch so, sofern du den Tag style im head der Seite abgelegt hast
    Christian

    Comment


    • #3
      Genau danach habe ich nicht geschaut! Habe den Fehler gefunden danke dir!

      Comment


      • #4
        HTML:
        Code:
        ...
        <table>
        <tr>
        <td><p>Inhalt</p></td>
        <td><p>Inhalt</p></td>
        <td><p>Inhalt</p></td>
        </tr>
        <tr>
        <td><p>Inhalt</p></td>
        <td><p>Inhalt</p></td>
        <td><p>Inhalt</p></td>
        </tr>
        <tr>
        <td><p>Inhalt</p></td>
        <td><p>Inhalt</p></td>
        <td><p>Inhalt</p></td>
        </tr>
        </table>
        CSS:
        Code:
        table tr td {
        background:#FFF;
        }
        table tr td:hover {
        background:#000;
        }
        Das müsste der Code sein

        Comment


        • #5
          Die Frage ist fast ein Jahr alt.....und der Fehler wurde gefunden
          Zuletzt editiert von Christian Marquardt; 07.01.2016, 21:12.
          Christian

          Comment

          Working...
          X