Adding class selector after pseudo selector in css

Viewed 1566

Can I add a class selector after a pseudo class in my CSS rule, e.g:

a:hover.my-class {
    background: red;
}

So if I hover over my anchor tag, <a class="my-class">link</a>, will the background be red in all browsers? is this valid CSS?


Why I need this

I have this problem because it is generated from a mixin in SASS:

@mixin focus($classA, $classB) {
  &:focus {
    &#{$classA} {
      background: blue;
    }

    &#{$classB} {
      background: yellow;
    }
  }
}

a {
  @include focus('.class-a', '.class-b')
}
2 Answers
Related