first-line-floats-004.xht (1087B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> 2 <title>CSS Test: :first-line</title> 3 <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" /> 4 <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> 5 <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line-pseudo" /> 6 <link rel="match" href="first-line-floats-001-ref.xht"/> 7 <meta name="flags" content="dom" /> 8 <style type="text/css"> 9 div { color: green } 10 div:first-line { color: red } 11 </style> 12 <script type="text/javascript"> 13 function runTest() { 14 var s = document.createElement("span"); 15 s.setAttribute("style", "float: left"); 16 s.appendChild(document.createTextNode("This should be green")); 17 var i = document.getElementById("i"); 18 i.parentNode.insertBefore(s, i); 19 } 20 </script> 21 </head> 22 <body onload="runTest()"> 23 <div><span id="i"></span></div> 24 25 26 27 </body></html>