![使用 CSS 为作为其父级的第二个子级的每个元素设置样式](https://img.php.cn/upload/article/000/887/227/169439382985620.jpg)
要使用CSS 為作為其父級的第二個子級的每個
元素設定樣式,請使用CSS :nth-child(n) 選擇器。
範例 h2>
您可以嘗試執行以下程式碼來實作:nth-child(n)選擇器
Live Demo
This is demo text 1.
This is demo text 2.
This is demo text 3.
This is demo text 4.
This is demo text 5.
This is demo text 6.
登入後複製
以上是使用 CSS 為作為其父級的第二個子級的每個元素設定樣式的詳細內容。更多資訊請關注PHP中文網其他相關文章!