For a while I relied on the following technique. But I did not often come across this, and I could not find information about this. Perhaps he has his own name, which I do not know about? I call it chaining because it looks like this: whole CSS class names together. But doing a chain search provides most of the information about jQuery.
.button {
background-color:#ccc;
}
.button.on {
background-color:#fff;
}
This allows me to use the same class name (on) to distinguish between the states of several elements.
<a class="button"></a>
<a class="button on"></a>
<a class="button-two"></a>
<a class="button-two on"></a>
This is very convenient with dynamic pages when you need to switch a class onto several elements using the same class name.
But is it really?
source
share