0

I'm styling a Button in Material-UI and I notice a strange behavior when I try to add style to the hover effect (strange because it was unexpected and I don't understand the difference). Initially I tried & :hover and only the inner span of the button was affected. I then tried &:hover and I got the desired style. Whats the difference between the two? Other than the space of course ^_^

Ry-
  • 218,210
  • 55
  • 464
  • 476
Mint
  • 1,013
  • 1
  • 12
  • 29

1 Answers1

3
  • &:hover effect directly to the element that you are selected
  • & :hover effect to elements that are inside your selected element.

From W3:

  • .class1.class2 Selects all elements with both - name1 and name2 set within its class attribute
  • .class1 .class2 Selects all elements with name2 that is a descendant of an element with name1
Ryan Le
  • 7,708
  • 1
  • 13
  • 23