MDN self-hosted library · e01.org

CSS nesting and specificity

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

html
<b class="foo">
  <i>Blue text</i>
</b>
css
:is(#a, b) {
  & i {
    color: blue;
  }
}

.foo i {
  color: red;
}