MDN self-hosted library · e01.org

`:-moz-first-node` CSS pseudo-class

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
:-moz-first-node {
  /* ... */
}
html
<p>
  <span>This matches!</span>
  <span>This doesn't match.</span>
</p>

<p>
  Blahblah.
  <span>This doesn't match because it's preceded by text.</span>
</p>
css
span:-moz-first-node {
  background-color: lime;
}