If I have written class="container bg-red" and in css I write .bg-red{background: red;} then it makes the background red so does that mean css will treat container{background: red;} and .containerbg-red{background: red;} the same way?
I tried .container{background:red;} and i worked but .containerbg-red{background:red;} didn’t work.
2
Answers
class="container bg-red"
means that you are applying both : class="container" and class="bg-red".Both container and bg-red is in the same level so you have to write
.container.bg-red {}
it will select an element with both the classes container and bg-red