if i specify like
.a ul{}
.a ul li{}
and
.b ul{}
.b ul li{}
Will the properties of ul in .b be totally separated from properties of ul of .a? or they will be common?
I want that the the styles of ul stays totally separated from style of ul in .b without using div id. thanks.
As long as you ensure in your HTML that you don’t have
class="a"elements insideclass="b"elements or vice versa, your selectors will apply to separate<ul>.They will only be common for
<ul>s in both.aand.bif:You group the selectors, like this:
You declare the exact same style rules for both selectors
In your HTML,
<ul>is contained within elements of both classes (whether it’sclass="a b"or.ainside.bor.binside.a), for example:Note that this only fully applies if the second bullet is also true; you may not get the results you expect due to the effects of the cascade.