The markup contains <p style='color: blue;'>Hello</p> and the author stylesheet contains:
p { color: red !important; }
What color is the text, and why?
Blue — a style attribute has the highest possible specificity, so no rule in a stylesheet can override it.
Red — the cascade sorts declarations by origin and importance before anything else, and an important author declaration outranks a normal one, including a normal declaration in a style attribute.✓پاسخ درست
Blue — !important only changes how a declaration competes with other rules inside stylesheets; it never competes with inline styles.
Red — marking a declaration !important resets the specificity of the competing style attribute to zero.
توضیح
The style attribute does not sit above everything; it sits above normal author rules. The cascade first sorts by origin and importance, and 'important author' is a higher bucket than 'normal author', which is where a plain style attribute participates. So the important declaration in the stylesheet wins and the text is red. Note the symmetry the wrong answers miss: had the inline declaration itself been written as color: blue !important, it would have won, because among important author declarations the style attribute again takes precedence.