I am trying to style these elements, and the element with two classes can't be style different than the one with one class. I've tried to select it with .red.balls also, but it doesn't work.
.ballsAll {
display: block;
margin-left: 14%;
}
.red {
background-color: red;
}
.balls {
background-color: white;
}
<div class='ballsAll'>
<p>
<span class='balls'>22</span>
<span class='balls red'>11</span>
</p>
</div>
Declare .balls before .red, Like this:
.ballsAll {
display: block;
margin-left: 14%;
}
.balls {
background-color: white;
}
.red {
background-color: red;
}
<div class='ballsAll'>
<p>
<span class='balls'>22</span>
<span class='balls red'>11</span>
</p>
</div>
Use this code:
.ballsAll {
display: block;
margin-left: 14%;
}
.red.balls {
background-color: red;
}
.balls {
background-color: white;
}
<div class='ballsAll'>
<p>
<span class='balls'>22</span>
<span class='balls red'>11</span>
</p>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With