Do CSS pseudo classes get read before other selectors? -
css reads right left, pseudo classes read before or after selectors attached to?
for example, in:
p:first-child {}
do browsers match every p-element, , determine whether it's first-child, or match every first kid of every element, , determine whether it's p-element?
i imagine browsers match element, , determines whether it's :first-child, :nth-child, etc., sure..
"do browsers match every p-element, , determine whether it's first-child, or match every first kid of every element, , determine whether it's p-element?"
neither. browser doesn't elements apply rules to, looks rules apply element.
when checking if rules applies element, doesn't create much difference if first checks whether p
element or whether it's first child. both quite easy determine.
css css-selectors
No comments:
Post a Comment