The Rule is not applying to the elements

0

I made a base with a class system for a certain color to an element. Even putting the rule he does not accept. Example:

<span class="mc c0 s1">Olá Mundo :D</span>

In CSS it looks like this:

.mc .c0 {
    color: red;
}

.mc .s0 {
    font-style: italic;
}

And you're not applying the c0 and s0 rule together or separate. even with !important together.

    
asked by anonymous 24.01.2017 / 16:30

1 answer

2

Because classes are part of the same element, the css selectors should run out of space:

.mc.c0 {
color: red;
}

.mc.s1 {
font-style: italic;
}
<span class="mc c0 s1">Olá Mundo :D</span>

So, .mc .c0 you're saying you want to select the element with the class c0 that is child, is contained, inside element with class mc , or refer to different elements.

    
24.01.2017 / 16:31