I have just started learning CSS and have come across an example that I do not fully understand. I cannot describe it well which has made finding an answer difficult (I therefore apologise if an answer already exists that I have overlooked).
My question is regarding the following example:
.theme-light.slider-wrapper {
background: #fff;
padding: 10px;
}
I understand that classes in CSS are defined using the .name syntax which can then be used in tags like so:
<div class="name"></div>
I do not understand how the “double” declaration of .name1 .name2 works and how this would be used in a tag.
On a related note the example website that I was given uses an ID in a tag that does not exist in the stylesheet.. where else could this have been defined?
Maybe this use example will clear things up for you.
Imagine the following scenario.
You would have:
And lets say you want div’s to have the same attributes as follows:
But you want the .general-div with .special class to have red background, and extra-div with .special class to have a blue background.
You would write:
Hope it clears up the use of situation in question.