Css 如何组合两个:not()s?
我正在尝试这样做:Css 如何组合两个:not()s?,css,css-selectors,Css,Css Selectors,我正在尝试这样做: :not(h1) > a, :not(figure) > a { background: #859900; } 但它不起作用,因为figure>a捕获:not(h1)>a和h1>a捕获:not(figure)>a。如何组合这些选项?使用此选项,可以组合多个:not()选择器: :not(h1):not(图)>a{ 背景#859900; } 组合两个:not()选择器,就像.class-a和的选择器一样。class-b是。class-a.class-b
:not(h1) > a,
:not(figure) > a {
background: #859900;
}
但它不起作用,因为
figure>a
捕获:not(h1)>a
和h1>a
捕获:not(figure)>a
。如何组合这些选项?使用此选项,可以组合多个:not()
选择器:
:not(h1):not(图)>a{
背景#859900;
}
组合两个:not()
选择器,就像.class-a
和的选择器一样。class-b
是。class-a.class-b
:not(h1):not(图)>a{
颜色:红色;
}
测试
试验
试验