B. btn-primary cannot be combined with size classes
C. btn-small is not a valid Bootstrap size class
D. btn class is missing
Solution
Step 1: Check Bootstrap size classes
Bootstrap uses btn-sm and btn-lg for sizes. btn-small is not valid.
Step 2: Verify other classes and syntax
The btn-primary and btn classes are correct and present. The button tag is properly closed.
Final Answer:
btn-small is not a valid Bootstrap size class -> Option C
Quick Check:
Use btn-sm or btn-lg for sizes [OK]
Hint: Use btn-sm or btn-lg, not btn-small [OK]
Common Mistakes:
Using btn-small instead of btn-sm
Thinking btn-primary can't combine with size classes
Missing btn class in button
5. You want a form with two buttons: a large green 'Save' button and a small red 'Cancel' button. Which code snippet correctly applies Bootstrap button sizes and colors?
hard
A. <button class="btn btn-success btn-sm">Save</button> <button class="btn btn-danger btn-lg">Cancel</button>
B. <button class="btn btn-success btn-lg">Save</button> <button class="btn btn-danger btn-sm">Cancel</button>
C. <button class="btn btn-primary btn-lg">Save</button> <button class="btn btn-warning btn-sm">Cancel</button>
D. <button class="btn btn-danger btn-lg">Save</button> <button class="btn btn-success btn-sm">Cancel</button>
Solution
Step 1: Match button colors to meanings
Bootstrap uses btn-success for green and btn-danger for red buttons.
Step 2: Apply correct sizes to buttons
The 'Save' button should be large, so use btn-lg. The 'Cancel' button should be small, so use btn-sm.
Step 3: Verify the correct combination
<button class="btn btn-success btn-lg">Save</button> <button class="btn btn-danger btn-sm">Cancel</button> correctly uses btn-success btn-lg for 'Save' and btn-danger btn-sm for 'Cancel'. Other options swap colors or sizes incorrectly.