active-selector-002

:active (basic test)

WeasyPrint

This browser

Flags
interact

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: :active (basic test)</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/selectors/active/002.xml" type="application/xhtml+xml">
 7   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/selectors/active/002.html" type="text/html">
 8   <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes">
 9   <meta name="flags" content="interact">
10   <style type="text/css">
11 
12    /* Make our document's head visible */
13    html { margin: 0; padding: 1em; }
14    head { display: block; }
15    title, style { display: none; }
16    link { display: inline; }
17    body { margin: 0; padding: 0; }
18    p { margin: 1em 0; }
19 
20    /* Make the metadata links invisible */
21    [rel="author"], [rel="alternate"], [rel="help"] { display: none; }
22 
23    /* The test */
24    link:before { content: '1. Link A'; }
25    /* Disabled due to http://www.w3.org/Bugs/Public/show_bug.cgi?id=11343
26       p:active, span:active { color: yellow; border: red solid thick; background: red; } */
27    .test { color: blue; }
28    a:active, link:active { color: white; background: green; border: green solid thick; }
29 
30    /* Informative status message */
31    .msg { background: white; color: white; line-height: 1.2 }
32    .msg p { margin: 0; margin-bottom: -1.2em; position: relative; }
33    :target { font-style: italic; color: silver; z-index: 1; }
34   </style>
35   <link class="test" href="#targetA" rel="bookmark">
36  </head>
37  <body>
38   <div><a class="test" href="#targetB">2. Link B</a></div>
39   <div><a class="test" href="#targetC"><span>3. Link C</span></a></div>
40   <p>Clicking the links above, or activating them with the keyboard, should make them go green in exactly the same way.</p>
41   <div class="msg">
42     <p>If you can see this sentence, ignore the sentences below.</p>
43     <p id="targetA">Link A was successfully activated.</p>
44     <p id="targetB">Link B was successfully activated.</p>
45     <p id="targetC">Link C was successfully activated.</p>
46   </div>
47  </body>
48 </html>