」工欲善其事,必先利其器。「—孔子《論語.錄靈公》
首頁 > 程式設計 > 如何在CSS中選擇第二個元素?

如何在CSS中選擇第二個元素?

發佈於2025-03-24
瀏覽:867

How to Select the Second Last Element in CSS? 
在Web開發中選擇第二個最後一個元素

為此目的,CSS3介紹了:nth-​​last-child(n)選擇器,其中n代表元素從末端計數的位置。 To select the second last element, we can use :nth-last-child(2).

This selector is applicable to the following example:

a
b
選擇此
c

使用:nth-​​last-child(2)選擇器,我們可以在不需要JQuery的情況下為所需的元素定型。

Firefox 3.5

Opera 9.5 [&&&&&&&&&&&&&&&&&&& && && && && && && && && unternit Explorer 9 [&& && && && && && &&華倍愛希希[&& && && &&&華希[&&&華[華倍愛希愛希希國[ *

最新教學 更多>

免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。

Copyright© 2022 湘ICP备2022001581号-3