first-line-selector-017.xht (1204B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 5 <head> 6 7 <!-- 8 Inspired by 9 Bug 8253: Can't dynamically add ::first-line / ::first-letter style 10 https://bugzilla.mozilla.org/show_bug.cgi?id=8253 11 --> 12 13 <title>CSS Test: First-line - dynamic :hover pseudo-class</title> 14 15 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 16 <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line-pseudo" title="5.12.1 The :first-line pseudo-element" /> 17 18 <meta content="interact" name="flags" /> 19 <meta content="The :first-line pseudo-element can be used and will apply onto an :hover pseudo-class." name="assert" /> 20 21 <style type="text/css"><![CDATA[ 22 div 23 { 24 background-color: white; 25 color: black; 26 font-size: 60px; 27 } 28 29 div:hover:first-line 30 { 31 background-color: blue; 32 color: white; 33 } 34 ]]></style> 35 36 </head> 37 38 <body> 39 40 <p>Test passes if "Text sample" becomes white on blue background when the mouse cursor hovers over it or hovers over its right-hand side.</p> 41 42 <div>Text sample</div> 43 44 </body> 45 </html>