| 1234567891011121314151617181920212223242526272829303132333435 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>048 link pseudo-class</title>
- <style>
- body { background: #ffffff; color: #202020; font-family: sans-serif;
- margin: 12px; }
- a:link { color: #000000; text-decoration: none; }
- a:visited { color: #ff0000; }
- a:hover { color: #00aa00; }
- </style>
- </head>
- <body>
- <h1>048 — a:link colour</h1>
- <p>Without pseudo-class support the engine uses the dark theme accent, so the
- link below is blue; <code>a:link</code> must make it black. The red
- visited and green hover rules must not stick permanently.</p>
- <p><a id="link" href="#target">BLACK LINK TEXT</a></p>
- <div id="result" style="background: #ffc8c8; color: #000000; padding: 8px;
- font-size: 18px;">checking...</div>
- <script>
- setTimeout(function () {
- var a = document.getElementById('link');
- var c = getComputedStyle(a);
- var ok = c.color === 'rgb(0, 0, 0)';
- var r = document.getElementById('result');
- if (r) {
- r.style.background = ok ? '#c8f0c8' : '#ffc8c8';
- r.textContent = (ok ? 'LINK-OK ' : 'LINK-FAIL ') + c.color;
- }
- }, 300);
- </script>
- </body>
- </html>
|