This question has already been answered:

The problem with which I, which is very strange, has not yet met. I have a structure similar to this:

<div class="items-wrap"> <a class="colink"></a> </div> 

And such classes: .items-wrap a , .colink .

The problem is that .items-wrap a binds to the link, and the local class .colink completely ignored.

Why is this so? And how do I fix this?

Reported as a duplicate by Visman members, aleksandr barakin , user194374, VenZell , Pavel Parshin 9 Mar '16 at 7:49 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • depending on what you mean. if you set the same property to both selectors, then the "weight" of the selector .items-wrap a greater than .colink . because its properties are more important - lexxl
  • show style definitions of these css-classes - Sergey Rufanov
  • @lexxl True, they repeat in the majority. The only option that I see now is the use of! Important, but it seems to me not quite right. The problem is that this is not my work and the use of .items-wrap a will have to be removed on dozens of pages. It is necessary to find a simple solution that will surpass this selector. - Telion
  • one
    @Levelleor !Important better to avoid, otherwise at some point you will have a project floor in them. In extreme cases, it should be used ... And you had better increase the weight of the selector ... so that it was more than .items-wrap a for example do so .items-wrap a.colink - Alexey Shimansky
  • @ Alexey Shimansky is brilliant, thank you. - Telion

2 answers 2

Change the .colink to a.colink in the css file.

 .items-wrap a { color: red; } a.colink { color: green; } 

Example

    Read here and increase the weight of your selector in a convenient / acceptable way for you. .items-wrap a.colink or .items-wrap .colink