<section>
  <h2>見出し</h2>
  <p>1</p>
  <p>2</p>
  <div>3</div>
  <p>4</p>
  <p>5</p>
  <p>6</p>
  <p>7</p>
  <div>8</div>
  <p>9</p>
  <p>10</p>
</section>
/* 3個目のp要素に効く */
section p:nth-of-type(3) {
  color: #ff0000;
}

/* 偶数個目のp要素に効く */
section p:nth-of-type(even) {
  color: #0000ff;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.