是否有可能将第一个具有特定类的目标定位在ul内?例如 :
有可能吗?
最佳答案
使用@L_301_0@伪类和adjacent sibling selector
+
.
.a:first-child,/* Select the first child element */
.a + .b { /* Select the first element with 'b' class */
background-color: dodgerblue;
}