reggie
reggie

Reputation: 3674

Selecting a div container

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?

Upvotes: 1

Views: 79

Answers (1)

Ja͢ck
Ja͢ck

Reputation: 173662

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.

Upvotes: 5

Related Questions