Recall & Review
beginner
What are utility classes in Bootstrap?
Utility classes are small, single-purpose CSS classes that apply specific styles like margin, padding, color, or display. They help quickly style elements without writing custom CSS.
Click to reveal answer
beginner
How do utility classes speed up development?
They let you add styles directly in HTML, reducing the need to write custom CSS. This saves time and keeps code simple and consistent.Click to reveal answer
beginner
Give an example of a Bootstrap utility class and what it does.The class
mt-3 adds a margin-top spacing of size 3 to an element, quickly adjusting spacing without custom CSS.Click to reveal answer
intermediate
Why do utility classes improve consistency in a project?
Because everyone uses the same predefined classes, the look and spacing stay uniform across the site, making it easier to maintain and update.
Click to reveal answer
intermediate
What is a potential downside of using too many utility classes?
HTML can become cluttered with many classes, which might make it harder to read. But this is balanced by faster styling and less CSS code.
Click to reveal answer
What is the main benefit of using Bootstrap utility classes?
✗ Incorrect
Utility classes let you quickly add styles in HTML, speeding up development without writing extra CSS.
Which Bootstrap utility class adds padding on all sides?
✗ Incorrect
p-3 adds padding on all sides. m-3 adds margin, pt-3 adds padding-top, and pl-3 adds padding-left.How do utility classes help maintain consistency?
✗ Incorrect
Using the same utility classes ensures consistent spacing, colors, and layout throughout the site.
What might happen if you use too many utility classes in HTML?
✗ Incorrect
Too many classes can clutter HTML, making it less readable, but it still speeds styling overall.
Which of these is NOT a utility class purpose?
✗ Incorrect
Utility classes style elements but do not handle behaviors like form validation.
Explain in your own words why utility classes speed up web development.
Think about how you style elements without writing new CSS.
You got /4 concepts.
Describe a situation where using utility classes would save you time compared to writing custom CSS.
Imagine you want to add margin or padding quickly.
You got /4 concepts.