dynamic-pseudo-classes-003.xht (830B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>CSS Test: Selectors: The dynamic pseudo-classes: :focus</title> 6 <link rel="author" title="Gabriele Romanato" href="mailto:gabriele.romanato@gmail.com" /> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes" /> 8 <meta name="flags" content="interact" /> 9 <meta name="assert" content="Browsers should honour the change of state in the elements"/> 10 <style type="text/css"> 11 a:focus {background-color: green; color: white} 12 13 </style> 14 </head> 15 <body> 16 <p>The link below should have a white text color and a green background color when it has focus.</p> 17 18 <p><a href="#">Link</a></p> 19 20 21 </body> 22 </html>