<div>
  <h1>1. No CSS applied</h1>
  <div>2. General Sibling</div>
  <h2>3. No CSS applied</h2>
  <div>4. General Sibling</div>
  <h3>5. No CSS applied</h3>
  <div>6. General Sibling</div>
  <div>7. General Sibling</div>
  <h1>8. No CSS applied</h1>
  <div>9. General Sibling</div>
</div>
h1 ~ div {
  color: red;
}

h3 ~ div{
  color: blue;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.