css:不是伪类不工作

时间:2017-01-22 04:48:57

标签: html css



:not( .banner-nav-not ) .banner-nav a{
  color: red;
}

  <div class="banner-nav clearfix">
      <ul>
        <li><a class="banner-nav-not" href="#">how we can help? <span>what we offer</span></a></li>
        <li><a href="#">mobile technologies</a></li>
        <li><a href="#">corporate training</a></li>
        <li><a href="#">online marketing</a></li>
        <li><a href="#">graphic design</a></li>
      </ul>
    </div>
&#13;
&#13;
&#13;

我想选择每一个&#34; a&#34;标签除了班级&#34; .banner-nav-not&#34;。

1 个答案:

答案 0 :(得分:1)

错误的订单。更改.banner-nav a:not( .banner-nav-not )

&#13;
&#13;
.banner-nav a:not( .banner-nav-not ) {
  color: red;
}
&#13;
<div class="banner-nav clearfix">
      <ul>
        <li><a class="banner-nav-not" href="#">how we can help? <span>what we offer</span></a></li>
        <li><a href="#">mobile technologies</a></li>
        <li><a href="#">corporate training</a></li>
        <li><a href="#">online marketing</a></li>
        <li><a href="#">graphic design</a></li>
      </ul>
    </div>
&#13;
&#13;
&#13;