What is the correct order of specificity for CSS selectors, from highest to lowest?
A). A. ID selectors, Class selectors, Element selectors, Inline styles
B). B. Inline styles, ID selectors, Class selectors, Element selectors
C). C. Inline styles, Element selectors, Class selectors, ID selectors
D). D. ID selectors, Inline styles, Class selectors, Element selectors
What is the significance of the order of styles in the CSS cascade?
A). A. The order determines the visual appearance of the webpage.
B). B. The order determines the download speed of CSS files.
C). C. The order determines the specificity of selectors.
D). D. The order determines which styles take precedence in case of conflicts.
How can conflicting styles be resolved in CSS?
A). A. By using inline styles.
B). B. By increasing the specificity of selectors.
C). C. By reordering the styles in the style sheet.
D). D. All of the above.
Which selector has higher specificity, an ID selector or a class selector?
A). A. ID selector
B). B. Class selector
C). C. They have equal specificity.
D). D. It depends on the specific use case.
What is the purpose of using inline styles in HTML?
A). A. To override styles declared in an external CSS file.
B). B. To apply styles directly to individual HTML elements.
C). C. To improve page loading performance.
D). D. To increase specificity of CSS rules.
How can the specificity of a CSS rule be increased?
A). A. By using fewer selectors.
B). B. By using more generic selectors.
C). C. By using the !important declaration.
D). D. By using inline styles.
Which CSS selector has the lowest specificity?
A). A. ID selectors
B). B. Class selectors
C). C. Inline styles
D). D. Element selectors
What is the correct way to override a CSS style declared in an external style sheet?
A). A. By using inline styles.
B). B. By using the !important declaration.
C). C. By reordering the styles in the style sheet.
D). D. By increasing the specificity of the selector.
When should the !important declaration be used in CSS?
A). A. Always, to ensure styles are applied consistently.
B). B. Sparingly, as it can lead to difficulties in maintaining styles.
C). C. Never, as it is deprecated in modern CSS.
D). D. Only when overriding browser default styles.
How does the cascade resolve conflicts between CSS styles?
A). A. By applying styles in the order they appear in the style sheet.
B). B. By giving priority to styles with higher specificity.
C). C. By ignoring conflicting styles.
D). D. By randomly selecting styles.