Maarten Wolfsen Maarten Wolfsen - 1 year ago 62
CSS Question

CSS :not() not working properly

So I have a code structure like this:

.header-container a:not(.header-menu-right a) {
display: none;

<div class="header-container">
<div class="header-menu-right">
<li><a href="#">link</a></li>
<!-- unimportant links -->
<li><a href="#">link</a></li>
<!-- unimportant links -->
<a href="#">link</a>
<!-- important link -->

As you can see by the notes, I only want CSS to change the last a-tag.

What am I doing wrong here?

Answer Source

Try this and there you go:

.header-container > a {


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download