MDN self-hosted library · e01.org

Descendant combinator

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

css
/* List items that are descendants of the "my-things" list */
ul.my-things li {
  margin: 2em;
}
css
selector1 selector2 {
  /* property declarations */
}
html
<ul>
  <li>
    <div>Item 1</div>
    <ul>
      <li>Subitem A</li>
      <li>Subitem B</li>
    </ul>
  </li>
  <li>
    <div>Item 2</div>
    <ul>
      <li>Subitem A</li>
      <li>Subitem B</li>
    </ul>
  </li>
</ul>
css
li {
  list-style-type: disc;
}

li li {
  list-style-type: circle;
}