Challenge - 5 Problems
Bootstrap Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What color will the text be?
Given the following HTML snippet using Bootstrap color utilities, what color will the text appear as in the browser?
Bootsrap
<p class="text-primary">Hello, world!</p>
Attempts:
2 left
💡 Hint
Bootstrap's text-primary class applies the primary theme color to text.
✗ Incorrect
The text-primary class in Bootstrap applies the primary theme color, which by default is blue. So the text will appear blue in the browser.
❓ selector
intermediate2:00remaining
Which class sets a red background?
Which Bootstrap utility class will set the background color of an element to red?
Attempts:
2 left
💡 Hint
Background color classes start with 'bg-'.
✗ Incorrect
The bg-danger class sets the background color to red in Bootstrap. The text-danger class changes text color, not background.
🧠 Conceptual
advanced2:00remaining
What happens if you combine text and background utilities?
Consider this HTML:
<div class="text-success bg-danger">Sample Text</div>. What will be the text and background colors?Bootsrap
<div class="text-success bg-danger">Sample Text</div>
Attempts:
2 left
💡 Hint
Text and background classes control different CSS properties.
✗ Incorrect
The text-success class sets the text color to green, while bg-danger sets the background color to red. They work independently.
❓ accessibility
advanced2:00remaining
Which color utility combination improves text readability?
You want to ensure good contrast for accessibility. Which combination of Bootstrap classes provides the best readable text on a dark background?
Attempts:
2 left
💡 Hint
Light text on dark background improves contrast.
✗ Incorrect
The text-light class applies a light color to text, which contrasts well on a bg-dark background, improving readability and accessibility.
📝 Syntax
expert2:00remaining
What error occurs with this invalid class name?
What happens if you use this class in Bootstrap:
bg--primary (note the double dash)?Bootsrap
<div class="bg--primary">Test</div>
Attempts:
2 left
💡 Hint
Invalid class names do not cause errors but do not apply styles.
✗ Incorrect
Using bg--primary is not a valid Bootstrap class. The browser ignores it, so no background color is applied. No syntax or runtime errors occur.