No, you got it wrong.
Consider this example:
<section class="container"> <div class="child level-1"> Потомок 1-го уровня <div class="child level-2">Потомок 2-го уровня</div> </div> </section> /* Случай А */ .container > .child { color: red; } /* Случай Б */ .container .child { color: red; }
In case A, the rule is assigned to the descendant of the first level and is inherited by the descendant of the 2nd.
In case B, the rule is assigned to descendants of all levels.
More accurate explanations:
In the first case, to change the descendant styles of the second level, it’s enough just to refer to it by a unique selector to overwrite the styles, because it does not fit into the target sample, and its own default selector has a weight of 0.
.container > .child { color: red; } .level-2 { color: blue; }
<section class="container"> <div class="child level-1"> Потомок 1-го уровня <div class="child level-2">Потомок 2-го уровня</div> </div> </section>
In the second case, in order to change the descendant styles of the second level, you will have to assign a selector whose weight is not less than that of the previous rule, since the element falls into the target sample.
.container .child { color: red; text-decoration: underline; } /* Так не сработает */ .level-2 { color: blue; }
<section class="container"> <div class="child level-1"> Потомок 1-го уровня <div class="child level-2">Потомок 2-го уровня</div> </div> </section>
To make the second case work, increase the weight of the selector.
.container .child { color: red; } /* Вес селектора не меньше, чем в предыдущем правиле */ .container .level-2 { color: blue; }
<section class="container"> <div class="child level-1"> Потомок 1-го уровня <div class="child level-2">Потомок 2-го уровня</div> </div> </section>