Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-pseudo/first-line-change-inline-color.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="first-line-change-inline-color-ref.html">
<style>
  #block { color: green; }
  #block::first-line { color: blue; }
  .green { color: green; }
</style>
<div id="block">
  <div>
    <p>Blue <span id="target">This text should be green.</span> Blue</p>
  </div>
</div>
<script>
requestAnimationFrame(() => {
  requestAnimationFrame(() => {
    target.className = 'green';
    document.documentElement.removeAttribute('class');
  });
});
</script>
</html>