0
0
CSSmarkup~5 mins

Fallback values in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are fallback values in CSS?
Fallback values are alternative CSS values used when the preferred value is not supported by the browser. They ensure the style still works and looks good.
Click to reveal answer
beginner
How do you write fallback values for the font-family property?
List multiple font names separated by commas. The browser uses the first available font. Example: font-family: Arial, Helvetica, sans-serif;
Click to reveal answer
intermediate
Why use fallback colors in CSS?
Fallback colors ensure text or backgrounds remain visible if a CSS function or variable is unsupported. For example, color: var(--main-color, black); uses black if the variable is missing.
Click to reveal answer
intermediate
Example of fallback for a CSS gradient background?
Use a solid color before the gradient. Example: background: #333; background: linear-gradient(to right, #333, #666); The solid color shows if gradients are unsupported.
Click to reveal answer
intermediate
What is the benefit of using fallback values in responsive design?
Fallback values help maintain usability and appearance on older browsers or devices that don’t support newer CSS features, improving accessibility and user experience.
Click to reveal answer
What happens if a browser does not support the first font in a font-family list?
AIt shows no text
BIt uses the next font in the list
CIt crashes
DIt uses a random font
Which CSS property example shows a fallback color using a CSS variable?
Acolor: black, var(--main-color);
Bcolor: black | var(--main-color);
Ccolor: var(--main-color, black);
Dcolor: var(--main-color);
Why add a solid color before a gradient background?
ATo center the gradient
BTo make the gradient brighter
CTo reduce file size
DTo provide a fallback if gradients are unsupported
Which is NOT a reason to use fallback values?
AMake CSS code shorter
BEnsure content visibility
CImprove browser compatibility
DEnhance user experience on old devices
How do fallback values help with accessibility?
ABy ensuring text and backgrounds remain visible
BBy hiding content on unsupported browsers
CBy disabling keyboard navigation
DBy changing font sizes automatically
Explain what fallback values are in CSS and why they are important.
Think about what happens if a browser does not understand a CSS value.
You got /3 concepts.
    Describe how to write fallback values for fonts and colors in CSS with examples.
    Use commas for fonts and var() with a second argument for colors.
    You got /3 concepts.