0
0
Bootsrapmarkup~20 mins

Color utilities (text, background) in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
AThe text will be blue.
BThe text will be gray.
CThe text will be green.
DThe text will be red.
Attempts:
2 left
💡 Hint
Bootstrap's text-primary class applies the primary theme color to text.
selector
intermediate
2:00remaining
Which class sets a red background?
Which Bootstrap utility class will set the background color of an element to red?
Abg-danger
Btext-danger
Cbg-primary
Dtext-danger-bg
Attempts:
2 left
💡 Hint
Background color classes start with 'bg-'.
🧠 Conceptual
advanced
2: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>
ABoth text and background will be red.
BText will be green, background will be red.
CText will be red, background will be green.
DBoth text and background will be green.
Attempts:
2 left
💡 Hint
Text and background classes control different CSS properties.
accessibility
advanced
2: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?
Atext-secondary on bg-dark
Btext-dark on bg-dark
Ctext-muted on bg-dark
Dtext-light on bg-dark
Attempts:
2 left
💡 Hint
Light text on dark background improves contrast.
📝 Syntax
expert
2: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>
ABootstrap applies a default background color.
BSyntaxError in HTML parsing.
CThe background color will not apply; no error shown.
DThe page crashes with a runtime error.
Attempts:
2 left
💡 Hint
Invalid class names do not cause errors but do not apply styles.