简体   繁体   中英

css :not pseudo class not working

 :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>

I want to select every "a" tag except class".banner-nav-not".

its a wrong order .change that .banner-nav a:not( .banner-nav-not )

 .banner-nav a:not( .banner-nav-not ) { 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM