Question

I have a <span class="tabs-fadding-number"></span> that have the following properties : :

.tabs-fadding-number {
    display: none;
    position: absolute;
    margin-left: 40%;
    top: -12px;
}

Now using Javascript I add another class to that span <span class="tabs-fadding-number add"></span> :

.tabs-fadding-number .add {
    color: #357ae8;
}

However my css rules is not applied. How can I have a child .add css class, that is only applicable to .tabs-fadding-number class elements ?

Thanks

Was it helpful?

Solution

Remove the space between the class names.

.tabs-fadding-number.add {
    color: #357ae8;
}

Otherwise, what you're doing is finding elements with .add that is within .tabs-fadding-number as a parent.

OTHER TIPS

Just look up in Chrome Developer. It's something like this

span.tabs-fadding-number.add
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top