0

Has anyone an idea why this span inside of an a override the !important red color?

a {
  color: red !important;
}

span {
  color: black;
}
<a href="/test">
  <span>Test</span>
</a>
johannchopin
  • 13,720
  • 10
  • 55
  • 101
  • 1
    this is a scope rule. try as `a * {color: red !important;}` and see. – doğukan Jul 23 '20 at 12:35
  • @dgknca Oh I didn't no that there was some kind of scope for `color`. Is there a way to fix it without using `a span {}`? – johannchopin Jul 23 '20 at 12:37
  • you are not overriding anything. You are selecting the span and applying color to it. The `a` selector is irrelevant and doesn't apply to span – Temani Afif Jul 23 '20 at 12:40

0 Answers0