I have the following code:
.llamativo{
border-left: 1px double darkgray;
border-bottom: 1px double darkgray;
box-shadow: 0 0 5px inset;
border-radius: 4px;
font-weight: bold;
font-size: 22px;
padding: 10px;
margin: 5px 0;
}
.llamativo .pred{
background-color: #eee!important;
}
.llamativo .rojo{
background-color: #ce0005!important;
}
.llamativo .azul{
background-color: #0082bf!important;
}
.llamativo .piel{
background-color: #eecc86!important;
}
<h1 class="llamativo azul">Título</h1>
The .red .blue .pred .skin classes are not applied, I don't understand why. I'm calling them, like the Snippet example , but it doesn't work.
They are not called because the second class is not found in a later element you should remove the space after
.llamativo
leaving it this way.llamativo.color
That is because, for example, the class
.pred
within the CSS must be within another call.llamativo
for it to work, you should eliminate the spaces that you have between the selectors, for example.llamativo.pred
The only thing you have to do is
.llamativo .pred
remove.llamativo
him and leave him alone with the class. or paste the classes in case you want the style only when the 2 are in the elementIn css to refer to a child of an element we do this:
and to add a style only if the element has two classes you have to remove the space between them something like this
and if it is simply an independent class it is like this: