The only thing you have to do is to .llamativo .pred
remove .llamativo
and leave the class alone. or paste the classes if you want the style only when the 2 are in the element
In css to refer to a child of an element we do this:
.llamativo .pred {...}
and to add a style only if the element has two classes you have to remove the space between them something like this
.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><!--tiene que tener las 2 clases para agregar los estilos-->
<h1 class="azul">Título</h1><!--No tiene las 2 clases y por eso no agrega los estilos-->
and if it's just an independent class, it's like this:
.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;
}
.pred{
background-color: #eee!important;
}
.rojo{
background-color: #ce0005!important;
}
.azul{
background-color: #0082bf!important;
}
.piel{
background-color: #eecc86!important;
}
<h1 class="llamativo azul">Título</h1>