nth-child

259 阅读1分钟
p:nth-child(n)选择的是父元素里的第n个元素,这个元素可能不是p,用处无限制

p:nth-of-type(n)选择的是父元素里的第n个p元素,只能用于标签