The Rule is not applying to the elements

Asked

Viewed 45 times

0

I made a basis with a class system for a certain color to an element. Even putting the rule it 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 it’s not applying the C0 and S0 rule or separate joints. even with the !important along.

1 answer

2


Since classes are part of the same element 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>

Because so, .mc .c0 are you saying you want to select the element with the class c0 child is contained within element with the class mc, or you mean different elements.

  • Um, it really worked. I didn’t expect that :)

  • 1

    hehe confess that a few years ago when I started I also went through this doubt @sysWOW32 . I’m glad I helped

Browser other questions tagged

You are not signed in. Login or sign up in order to post.