今回はCSSの:nth-of-type()や:nth-child()で「○番目〜○番目」「○番目以降」といった特定の範囲だけ指定する方法を解説します。 ○番目以降の範囲「○番目以降の要素」を指定する場合は:nth-of-type(n+○)と書きます。 例えば4番目以降の要素を指定したい場合は:nth-of-type(n+4)となります(HTMLは以降共通です)。 <div class="wrapper"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> <div class="item">7</div> <div class="i
![CSSのnth-of-type()やnth-child()で特定の範囲だけ指定する方法](https://cdn-ak-scissors.b.st-hatena.com/image/square/272cfc579ada643bc15c7fefcf96d7b65e0d2a9d/height=288;version=1;width=512/https%3A%2F%2Fdezanari.com%2Fwp-content%2Fuploads%2F2019%2F01%2F5e5038084054cda0402bf3ea109ee722.png)