Hi @Roger_Rohweder, and welcome to the community!
So, looking at your sample code, neither .alert .stop
nor .alert .go
are doing anything. These will only select:
- an element with a
class
of stop
, which is inside an element with a class
of alert
- an element with a
class
of go
, which is inside an element with a class
of alert
respectively.
the elements with class="alert stop"
or class="alert go"
on them won’t be selected by either of the above two selectors, but they will still be styled by the following rule:
.alert {
border: 3px solid grey;
}
.alert
will select any element with a class
of alert
on it, regardless of whether it has other classes set on it or not.
Now, moving on to .alert.stop
and .alert.go
. Respectively, these will select:
- An element with
alert
and stop
classes set on it.
- An element with
alert
and go
classes set on it.
So for example, <span class="alert stop">
is being styled by both of the following rules:
.alert {
border: 3px solid grey;
}
.alert.stop {
border: 3px solid red;
}
Hope this helps — one tip that helped me to figure out what is going on (as I’m a bit color blind!) is to give the rules with the .alert.stop
and .alert.go
selectors a bigger border (e.g. 6px solid black
) so it is easier to see when they are or aren’t being applied.