css3-modsel-18.xml (1873B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>:hover pseudo-class</title> 5 <style type="text/css"><![CDATA[p:hover { background-color : lime } 6 a:hover { background-color : lime } 7 8 tr:hover { background-color : green } 9 td:hover { background-color : lime } 10 11 table { border-spacing: 5px; }]]></style> 12 <link rel="author" title="Daniel Glazman" href="http://glazman.org/"/> 13 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 14 <link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found --> 15 <meta name="flags" content=" interact" /> 16 </head> 17 <body> 18 <p>The background color of this paragraph should turn to green when 19 the mouse pointer hovers either its text (<strong>here</strong>) or its whitespace background, <strong>here</strong>:</p> 20 <address>The background color of <a href="#foo">this anchor (<strong>here</strong>)</a> should turn to green when the pointing device hovers over it.</address> 21 <table> 22 <tbody> 23 <tr> 24 <td>The cells in</td> 25 <td>this table</td> 26 <td>should go</td> 27 </tr> 28 <tr> 29 <td>green when</td> 30 <td>you hover</td> 31 <td>the pointing</td> 32 </tr> 33 <tr> 34 <td>device over</td> 35 <td>them (<strong>here</strong>).</td> 36 <td></td> 37 </tr> 38 <tr> 39 <td>The rows in</td> 40 <td>this table</td> 41 <td>should go</td> 42 </tr> 43 <tr> 44 <td>dark green</td> 45 <td>when the</td> 46 <td>pointing device</td> 47 </tr> 48 <tr> 49 <td>is over the</td> 50 <td>cells <strong>there</strong>:</td> 51 <td></td> <!-- remove this cell to make an evil test; row should still go green, but cell should not --> 52 </tr> 53 <tr> 54 <td>And <strong>here</strong>:</td> 55 <td></td> 56 <td>(blank cells).</td> 57 </tr> 58 </tbody> 59 </table> 60 </body> 61 </html>