Order of precedence
Brainteasers / Quiz
(1)
Here is a combination that has not been mentioned yet about the order of precedence in the cascade.
Imagine this:
- serif font-family in a linked style sheet for the paragraphs.
- sans-serif font-family in an imported style sheet for the paragraphs.
Which one will take precedence? Which one will be applied to the paragraphs in the document?
Choose an answer:
[Explanation]
Explanation
The import command exists within the document level style tags:
<style type="text/css">
@import url(myImportedStyles.css);
</style>
So the imported style sheet is lower in the cascade than the linked style sheet.
- The style at the lower level in the cascade will take precedence if it conflicts with any styles at the upper levels for the same element.
The style in the imported style sheet for the paragraphs will take precedence instead of the style in the linked style sheet for the paragraphs.
Help
Review: