5. You want to create a reusable Bootstrap card component that shows a title and text. Which approach best follows the component-based philosophy?
hard
A. Use Bootstrap card classes and create a reusable template or component in your code
B. Create a custom CSS class and write card HTML manually each time
C. Write the card HTML once and copy-paste it everywhere
D. Avoid using Bootstrap and write all styles inline
Solution
Step 1: Understand component-based philosophy
It encourages reusable parts that can be used multiple times without rewriting code.
Step 2: Evaluate options for reusability and Bootstrap usage
Use Bootstrap card classes and create a reusable template or component in your code uses Bootstrap classes and creates a reusable template/component, which is best practice.
Final Answer:
Use Bootstrap card classes and create a reusable template or component in your code -> Option A
Quick Check:
Reusable templates + Bootstrap classes = best practice [OK]
Hint: Reuse Bootstrap classes with templates/components [OK]
Common Mistakes:
Copy-pasting code instead of reusing components
Writing custom CSS unnecessarily
Avoiding Bootstrap and inline styles
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.