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,523
  • 14
  • 62
  • 97

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
  • 170,779
  • 38
  • 263
  • 309