Challenge - 5 Problems
Bootstrap Heading Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual size of this heading?
Given this HTML code using Bootstrap classes, what will be the size of the heading text shown in the browser?
<h3 class="display-1">Hello</h3>Bootsrap
<h3 class="display-1">Hello</h3>
Attempts:
2 left
💡 Hint
Bootstrap's display classes make text bigger than normal heading tags.
✗ Incorrect
The class display-1 in Bootstrap makes text very large, bigger than normal h1 to h6 headings. Even if used on an h3 tag, the text size changes to display-1 style.
❓ selector
intermediate2:00remaining
Which class makes a heading smaller than display-1 but bigger than display-4?
In Bootstrap, which class should you add to a heading to make it appear smaller than display-1 but bigger than display-4?
Attempts:
2 left
💡 Hint
Display classes go from display-1 (largest) to display-4 (smallest).
✗ Incorrect
display-3 is smaller than display-1 and display-2 but bigger than display-4. So it fits between display-1 and display-4 sizes.
🧠 Conceptual
advanced2:00remaining
What happens if you use multiple display classes on one heading?
Consider this HTML:
What will be the size of the heading text?
<h2 class="display-2 display-4">Test</h2>What will be the size of the heading text?
Bootsrap
<h2 class="display-2 display-4">Test</h2>
Attempts:
2 left
💡 Hint
In CSS, when multiple classes of equal specificity set the same property, the one declared later in the stylesheet wins.
✗ Incorrect
In the CSS cascade, rules with equal specificity later in the stylesheet override earlier ones. Bootstrap's stylesheet defines .display-4 after .display-2, so display-4's styles override.
❓ accessibility
advanced2:00remaining
Which heading class combination is best for screen readers and visual hierarchy?
You want a heading that looks very large visually but is still an h3 for screen readers and SEO. Which is the best HTML code?
Attempts:
2 left
💡 Hint
Use semantic heading tags with display classes for best accessibility.
✗ Incorrect
Using an h3 tag with display-1 class keeps the semantic heading level for screen readers and SEO, while making it visually large.
📝 Syntax
expert2:00remaining
What error occurs with this Bootstrap heading class usage?
What error or problem will this code cause?
<h4 class="display-7">Oops</h4>Bootsrap
<h4 class="display-7">Oops</h4>
Attempts:
2 left
💡 Hint
Bootstrap defines display-1 to display-4 only.
✗ Incorrect
Bootstrap does not define display-7 class, so it has no effect. The heading shows with normal h4 size.