Match elements with no siblings using a CSS selector

The :only-of-type pseudo-class allows selecting an element that doesn’t have siblings of the same type.

For example, consider the following stylesheet:

p:only-of-type {
  color: magenta;
}

Now, only the third <p> will be in magenta:

<div>
  <p>I'm the first div.</p>
  <p>I'm the second div.</p>
</div>
<div>
  <p>I'm the third div. I'll be in magenta</p>
</div>

More information can be found on MDN.