What mechanism allows reuse of values across a stylesheet?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

What mechanism allows reuse of values across a stylesheet?

Explanation:
CSS Custom Properties (variables) let you store a value in one place and reuse it throughout a stylesheet with the var() function. By defining a value on a broad scope like the root, you can apply the same value to any number of rules, e.g., color: var(--primary-color); or background-color: var(--primary-color); This keeps styling consistent and makes updates easy—change the single variable and every place that references it updates automatically. You can also override the variable in specific scopes or within media queries to adapt themes without rewriting multiple rules. Media queries control when styles apply, not how values are reused; inheritance passes values from a parent to its children but doesn’t provide a centralized reuse mechanism; the user agent stylesheet is just the browser’s default styles.

CSS Custom Properties (variables) let you store a value in one place and reuse it throughout a stylesheet with the var() function. By defining a value on a broad scope like the root, you can apply the same value to any number of rules, e.g., color: var(--primary-color); or background-color: var(--primary-color); This keeps styling consistent and makes updates easy—change the single variable and every place that references it updates automatically. You can also override the variable in specific scopes or within media queries to adapt themes without rewriting multiple rules. Media queries control when styles apply, not how values are reused; inheritance passes values from a parent to its children but doesn’t provide a centralized reuse mechanism; the user agent stylesheet is just the browser’s default styles.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy