:not(:last-child)を使用したサンプル

text 1

text 2

text 3
<ul>
  <li>list1</li>
  <li>list2</li>
  <li>list3</li>
</ul>
<section>
  <p>text 1</p>
  <p>text 2</p>
  <div>text 3</div>
</section>
ul > :not(:last-child) {
  border: 1px solid red;
}
section > :not(:last-child) {
  border: 1px solid green;
}

元記事を表示する