-1

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-
  • 209,133
  • 54
  • 439
  • 449
Mint
  • 819
  • 1
  • 8
  • 22

1 Answers1

2
  • &: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
  • 6,396
  • 1
  • 10
  • 19