1、选择以class为one 父元素的 第二个子元素
$("div.one : nth-child(2)")//选取子元素需要加一个空格
2、选择class为one的第一个子元素
$("div.one :fiist-child")
3、选择class为one的最后一个·子元素
$("div.one :last-child")
4、选择class为one只有一个子元素的
$(".one :only-child")
本文深入探讨了CSS中元素的选择方法,包括如何通过类名、位置属性等来精准选择网页中的元素,提供了从基本到进阶的全面指南。
1、选择以class为one 父元素的 第二个子元素
$("div.one : nth-child(2)")//选取子元素需要加一个空格
2、选择class为one的第一个子元素
$("div.one :fiist-child")
3、选择class为one的最后一个·子元素
$("div.one :last-child")
4、选择class为one只有一个子元素的
$(".one :only-child")

被折叠的 条评论
为什么被折叠?