0

I used the #footer a selector before, but after removing #footer to make the change apply to all <a>'s on the page except the ones in a div with a class of .navbar, no links get the following selectors assigned: a:not(.navbar a),a:not(.navbar a):hover, a:not(.navbar a):active (also seen in Google Chrome element inspector)

I created 2 jsFiddles to represent what I'm trying to say:

  1. Working example of first version
  2. Broken, new code

I have to fix it again, so it applies to the entire page, except that one div.

BoltClock
  • 665,005
  • 155
  • 1,345
  • 1,328
SeinopSys
  • 8,418
  • 9
  • 57
  • 108

1 Answers1

2

You cannot do a:not(.navbar a) in CSS.

If you know your a will always be directly nested within .navbar and you want to exclude that a, you could select :not(.navbar) > a instead. But if the nesting level is arbitrary and you want to exclude a nested anywhere within .navbar, then you'll probably have trouble writing a CSS selector for that. Something like :not(.navbar) a can always match some other element higher up in the tree. See this answer for another example of why it won't work.

The simplest solution to this is to apply the effects to all a elements, then undo them in .navbar a:

.navbar a {
  text-shadow:none;
  padding:0;
  -webkit-transition-property: none;
  -moz-transition-property: none;
  -o-transition-property: none;
  transition-property: none;
}

jsFiddle preview

Community
  • 1
  • 1
BoltClock
  • 665,005
  • 155
  • 1,345
  • 1,328