I'm curious why using >
or other combinators does not affect the specificity of CSS selectors, i.e. why div span
(matching a span somewhere inside a div) and div > span
(matching a span which is the immediate child of a div) are considered equal regarding the specificity.
I do realize that the usage of combinators is completely irrelevant for the specificity but I wonder if there's a certain reason for it.
span
that is a descendant of adiv
" and "aspan
that is a child of adiv
", rather than something more specific, such as "aspan
with some class name that is a child of adiv
". – Tartrazinea b
is adescendant
selector,a > b
is achild
selector.</pedantics> – Idiolect