1

How can I select the likebtn container with CSS?

selector screenshot

I have tried several combinations, for example "#meta #likebtn{}" or "#likebtn{}" and it did not work. Why does this work?

reggie
  • 3,234
  • 13
  • 57
  • 88

1 Answers1

5

First, you target it as direct as possible:

#likebtn {
    /* desired style changes here */
}

Then open your developer tools and check the style inspector; if your CSS rules are being overridden somewhere it will tell you what selector was used to override it.

For instance, this could override your rule:

#meta #likebtn

The next step is to either:

  • declare your rule with the same selector after the earlier declaration or,
  • be more precise.
Ja͢ck
  • 161,074
  • 33
  • 239
  • 294