<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Universal Selectors</title>
</head>

<body>
  <div class="container">
    <div class="orange">This is a div element</div>
    <span>This is a span element</span>
    <span>This is a span element</span>
    <ul>
      <li>First li element </li>
      <li>Second li element </li>
      <li class="red">Third li element </li>
      <li>Fourth li element </li>
      <li>Fifth li element </li>
    </ul>
  </div>
  <div>
    <span>
      <h3> This is heading inside span element</h3>
    </span>
  </div>
</body>

</html>
/* Selecting li element which is right after red class */
li.red ~ li {
  background-color: #1faa59;
}

/* Selecting only one direct sibling which comes inside div */
div + span {
  background-color: #5a20cb;
  color: white;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.