Challenge - 5 Problems
Bootstrap Button Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the output of this Bootstrap button code?
Consider the following HTML snippet using Bootstrap classes:
What will the button look like when rendered in a browser?
<button class="btn btn-primary">Click Me</button>
What will the button look like when rendered in a browser?
Bootsrap
<button class="btn btn-primary">Click Me</button>
Attempts:
2 left
💡 Hint
Bootstrap's btn-primary class gives a blue background with white text.
✗ Incorrect
The class 'btn-primary' in Bootstrap styles the button with a blue background and white text, along with rounded corners by default.
🧠 Conceptual
intermediate2:00remaining
Which Bootstrap class creates a button with no background and blue text?
You want a button that looks like a link: no background color but blue text. Which Bootstrap class should you use?
Attempts:
2 left
💡 Hint
Think about which class makes buttons look like links.
✗ Incorrect
The 'btn-link' class styles buttons to look like links with no background and blue text by default.
❓ selector
advanced2:00remaining
Which CSS selector targets all Bootstrap buttons with outline style?
Bootstrap uses classes like 'btn-outline-primary' for outline buttons. Which CSS selector matches all buttons with any outline style?
Attempts:
2 left
💡 Hint
Look for attribute selectors that match class names starting with a pattern.
✗ Incorrect
The selector [class^="btn-outline-"] matches elements whose class attribute starts with 'btn-outline-', covering all outline button variants.
❓ layout
advanced2:00remaining
How to create a group of buttons that share the same width in Bootstrap?
You want three buttons side by side, each exactly the same width, filling the container evenly. Which Bootstrap approach achieves this?
Attempts:
2 left
💡 Hint
Bootstrap flex utilities help buttons fill space evenly.
✗ Incorrect
Using 'btn-group' with 'flex-fill' on each button makes them share equal width inside the group.
❓ accessibility
expert2:00remaining
Which attribute improves accessibility for icon-only Bootstrap buttons?
You have a Bootstrap button that only shows an icon (no text). Which attribute should you add to make it accessible for screen readers?
Bootsrap
<button class="btn btn-primary"><i class="bi bi-star"></i></button>
Attempts:
2 left
💡 Hint
Screen readers need descriptive text for buttons without visible text.
✗ Incorrect
The 'aria-label' attribute provides an accessible name for screen readers when the button has no visible text.