Hassan
Hassan

Reputation: 910

Why do some of the css properties do not take effect?

Why isn't the following style taking effect?

.tags a{
  color: red;
}

I can force the property by appending !important to it.

Code: http://codepen.io/haxan7/pen/QyQNBR

Upvotes: 0

Views: 61

Answers (2)

Siva
Siva

Reputation: 2785

Both of the following two declarations are applicable for the anchor texts.

.theme .content a{
  color: green;
}

.tags a{
  color: red;
}

color "green" has more specificity then color "red" and thats why "green" is getting applied. Increase the specificity for color "red" then it will get applied.

.theme .content .tags a {
 color: red;
}

Upvotes: 4

Hunter Turner
Hunter Turner

Reputation: 6894

Because your .theme .content a style is setting the a tag color to green.

Change this in your code:

.theme .content a{
  color: red;
}

Upvotes: 1

Related Questions