Grow your CSS skills. Land your dream job.

Child

Last updated on:

A child selector in CSS is the "greater than" symbol, it looks like this:

ol > li {
  margin: 5px;
}

It means "select elements that are direct descendants only". In this case: "select list items that are direct descendants of an ordered list". To illustrate:

<ol>
  <li>WILL be selected</li>
  <li>WILL be selected</li>
  <ul>
     <li>Will NOT be selected</li>
     <li>Will NOT be selected</li>
  </ul>
  <li>WILL be selected</li>
</ol>

More Information

Browser Support

Chrome Safari Firefox Opera IE Android iOS
Any Any Any Any 7+ Any Any

Leave a Comment

Current day month ye@r *

*May or may not contain any actual "CSS" or "Tricks".