-4

Please see below two, Could anyone explain to me the difference a.class and class.a:

.MyClass a:link, .MyClass a:visited {
color:red;
}


a.MyClass :link, a.MyClass :visited {
color:green;
}
  • Check this [CSS selectors](https://www.w3schools.com/cssref/css_selectors.asp) – Luca Apr 05 '20 at 13:27
  • DON'T REPOST THE SAME QUESTION! if it's not a duplicate then edit the first one and explain why you tink it's not a duplicate https://stackoverflow.com/questions/61041348/what-are-the-difference-between-these-two-css-class-to-a-link – Alon Eitan Apr 05 '20 at 13:30

1 Answers1

-1

a.class refers to a a tag (link) which has the class class.
.class a refers to a a tag inside any tag which has the class class.

<div class="class">
   <a>Link</a>
</div>
<a class="class">Link</a>
.class a {
  // This will affect the first chunk
}

a.class {
  // This will affect the second chunk
}
VRoxa
  • 907
  • 6
  • 22