I understand that in nested CSS rules, the selector is applied from the most nested one, going bottom-up. For example in the following:
.foo > .bar .baz{
...
}
.baz
elements are selected from the page, then it is restricted to those that are descendants of .bar
, then it is restricted to those that are childs of .foo
. Why does it work this way? I read that this is causing inefficiency in nested CSS rules. In most cases, I believe top-down restriction would be more efficient.