css3-modsel-18a.xml (1318B)
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 on links</title> 5 <style type="text/css"><![CDATA[ 6 p { color: navy; } 7 8 .a a:hover { background: green; color: white; } 9 10 .b a:hover { background: red; color: yellow; } 11 .b a:link { background: green; color: white; } 12 13 .c :link { background: green; color: white; } 14 .c :visited:hover { background: red; color: yellow; } 15 ]]></style> 16 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 17 <link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found --> 18 <meta name="flags" content=" interact" /> 19 </head> 20 <body> 21 <p class="a">The background color of <a href="#foo">this anchor (<strong>here</strong>)</a> should turn to green when the pointing device hovers over it.</p> 22 <p class="b">The background color of <a href="#foo">this anchor (<strong>here</strong>)</a> should <strong>remain green when you hover it</strong>.</p> 23 <p class="c">The background color of <a href="http://link.example.com/">this anchor (<strong>here</strong>)</a> should <strong>remain green when the pointing device hovers over it</strong> (do not follow that link).</p> 24 </body> 25 </html>