0
0
Bootsrapmarkup~20 mins

Button styles and variants in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Button Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the output of this Bootstrap button code?
Consider the following HTML snippet using Bootstrap classes:
<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>
AA green button with black text and shadow
BA red button with white text and sharp corners
CA transparent button with blue text and underline
DA blue button with white text and rounded corners
Attempts:
2 left
💡 Hint
Bootstrap's btn-primary class gives a blue background with white text.
🧠 Conceptual
intermediate
2: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?
Abtn-link
Bbtn-primary
Cbtn-outline-primary
Dbtn-secondary
Attempts:
2 left
💡 Hint
Think about which class makes buttons look like links.
selector
advanced
2: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?
A[class^="btn-outline-"]
B.btn-outline-primary, .btn-outline-secondary, .btn-outline-success
C.btn[class*="outline"]
D.btn-outline
Attempts:
2 left
💡 Hint
Look for attribute selectors that match class names starting with a pattern.
layout
advanced
2: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?
AUse 'btn-group w-100' and add 'w-100' to each button
BWrap buttons in 'btn-group' and add 'flex-fill' to each button
CUse 'btn-group' only, no extra classes
DWrap buttons in 'btn-toolbar' and add 'flex-fill' to each button
Attempts:
2 left
💡 Hint
Bootstrap flex utilities help buttons fill space evenly.
accessibility
expert
2: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>
Atitle="Star button"
Brole="button"
Caria-label="Star button"
Dalt="Star icon"
Attempts:
2 left
💡 Hint
Screen readers need descriptive text for buttons without visible text.