I have two css expressions:
.firstexpression.secondexpression (without space)
and
.firstexpression .secondexpression (with space)
What is the difference?
I have two css expressions:
.firstexpression.secondexpression (without space)
and
.firstexpression .secondexpression (with space)
What is the difference?
The first applies to elements with BOTH classes applied, the second to a child element with .secondexpression
with a parent with .firstexpression
.firstexpression.secondexpression{
/* styles */
}
Applies to:
<div class='firstexpression secondexpression'>Applies to this element</div>
Vs..
.firstexpression .secondexpression{
/* styles */
}
Applies to:
<div class='firstexpression'>
<div class='secondexpression'>Applies to this element only</div>
</div>