Bird
Raised Fist0
Bootsrapmarkup~20 mins

Text alignment utilities in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Text Alignment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What does the class text-center do in Bootstrap?
In Bootstrap, what is the visual effect of applying the class text-center to a paragraph?
AIt aligns the text to the right side of the container.
BIt aligns the text to the left side of the container.
CIt justifies the text so that both edges align with the container edges.
DIt aligns the text to the center horizontally within its container.
Attempts:
2 left
💡 Hint
Think about how text alignment works in CSS and what 'center' means.
📝 Syntax
intermediate
1:30remaining
Which Bootstrap class aligns text to the right?
You want to align a heading's text to the right side using Bootstrap classes. Which class should you use?
Atext-end
Btext-right
Ctext-justify
Dtext-left
Attempts:
2 left
💡 Hint
Bootstrap 5 uses logical properties for alignment.
❓ rendering
advanced
2:00remaining
What is the visual output of this HTML snippet with Bootstrap classes?
Given the following HTML code, what will be the horizontal alignment of the text inside the <div> when viewed in a browser?

<div class="text-sm-start text-md-center text-lg-end">Responsive Text</div>
AText is left-aligned on small screens, centered on medium screens, and right-aligned on large screens.
BText is always centered regardless of screen size.
CText is right-aligned on small screens, left-aligned on medium screens, and centered on large screens.
DText is left-aligned on all screen sizes.
Attempts:
2 left
💡 Hint
Bootstrap uses responsive classes that apply at different screen widths.
❓ selector
advanced
1:30remaining
Which CSS property does Bootstrap's text-justify class apply?
Bootstrap has a class called text-justify. Which CSS property and value does it apply to the element?
Atext-align: center;
Btext-align: justify;
Ctext-align: right;
Dtext-align: start;
Attempts:
2 left
💡 Hint
Justify means text edges align on both left and right sides.
❓ accessibility
expert
2:00remaining
How does text alignment affect accessibility and readability?
Which statement best explains the accessibility impact of using text-center for large blocks of text in Bootstrap?
AText alignment has no impact on accessibility or readability.
BCenter alignment improves readability for all users by creating balanced text edges.
CCenter-aligned large text blocks can reduce readability for users with dyslexia or cognitive disabilities.
DCenter alignment is recommended for all paragraphs to enhance screen reader performance.
Attempts:
2 left
💡 Hint
Think about how eyes track lines of text and how alignment affects that.

Practice

(1/5)
1. Which Bootstrap class aligns text to the right side of its container?
easy
A. text-start
B. text-center
C. text-right
D. text-end

Solution

  1. Step 1: Understand Bootstrap text alignment classes

    Bootstrap uses text-start for left, text-center for center, and text-end for right alignment.
  2. Step 2: Identify the class for right alignment

    The class text-end aligns text to the right side of the container.
  3. Final Answer:

    text-end -> Option D
  4. Quick Check:

    Right aligned text = text-end [OK]
Hint: Right alignment uses text-end class in Bootstrap [OK]
Common Mistakes:
  • Using text-right which is not a Bootstrap 5 class
  • Confusing text-start with right alignment
  • Choosing text-center instead of right alignment
2. Which of the following is the correct syntax to center text on small screens and larger using Bootstrap?
easy
A. text-sm-center
B. text-center-sm
C. text-center-sm-up
D. text-center-sm-down

Solution

  1. Step 1: Recall Bootstrap responsive text alignment classes

    Bootstrap uses the format text-{breakpoint}-{alignment} for responsive text alignment.
  2. Step 2: Match the correct syntax for small screens and up

    The correct class to center text on small screens and larger is text-sm-center.
  3. Final Answer:

    text-sm-center -> Option A
  4. Quick Check:

    Responsive center text = text-sm-center [OK]
Hint: Responsive classes use text-{breakpoint}-{alignment} format [OK]
Common Mistakes:
  • Placing breakpoint after alignment like text-center-sm
  • Adding extra suffixes like -up or -down which don't exist
  • Using incorrect order of class parts
3. What will be the alignment of the text inside this <p> tag on a medium screen?
<p class="text-md-end">Hello Bootstrap!</p>
medium
A. Text aligned to the left
B. Text aligned to the center
C. Text aligned to the right
D. Text alignment unchanged (default left)

Solution

  1. Step 1: Understand the class text-md-end

    This class aligns text to the right starting at medium screen sizes and larger.
  2. Step 2: Determine alignment on medium screen

    On medium screens, the text will be aligned to the right because of text-md-end.
  3. Final Answer:

    Text aligned to the right -> Option C
  4. Quick Check:

    Medium screen text alignment = right [OK]
Hint: md-end means right alignment on medium screens and up [OK]
Common Mistakes:
  • Assuming text is centered instead of right aligned
  • Thinking alignment applies only on small screens
  • Ignoring responsive breakpoint effect
4. You want to align text to the center on all screen sizes but accidentally use text-center-sm. What is the problem with this class?
medium
A. It centers text only on small screens and larger, not on extra small screens
B. It causes a syntax error and text won't display
C. It aligns text to the left instead of center
D. It centers text only on extra small screens

Solution

  1. Step 1: Understand text-center-sm meaning

    This class centers text starting from small screens and larger, but not on extra small screens.
  2. Step 2: Identify the problem for extra small screens

    On extra small screens, text will not be centered but use default alignment (usually left).
  3. Final Answer:

    It centers text only on small screens and larger, not on extra small screens -> Option A
  4. Quick Check:

    text-center-sm skips extra small screens [OK]
Hint: Responsive classes start applying at their breakpoint, not before [OK]
Common Mistakes:
  • Thinking it centers text on all screen sizes
  • Assuming it causes syntax errors
  • Confusing small screens with extra small screens
5. You want text to be left aligned on extra small screens, centered on medium screens, and right aligned on large screens. Which class combination achieves this?
hard
A. text-start text-center-md text-end-lg
B. text-start text-md-center text-lg-end
C. text-left text-center text-right
D. text-start-md text-center-lg text-end

Solution

  1. Step 1: Identify classes for each breakpoint

    Left aligned on extra small screens uses text-start (applies by default). Center on medium screens uses text-md-center. Right on large screens uses text-lg-end.
  2. Step 2: Check the class combination syntax

    text-start text-md-center text-lg-end correctly uses text-start, text-md-center, and text-lg-end in proper order and syntax.
  3. Final Answer:

    text-start text-md-center text-lg-end -> Option B
  4. Quick Check:

    Left, center, right at xs, md, lg = text-start text-md-center text-lg-end [OK]
Hint: Use text-start, text-md-center, text-lg-end for progressive alignment [OK]
Common Mistakes:
  • Using incorrect class order or syntax
  • Using deprecated classes like text-left
  • Mixing breakpoint and alignment order incorrectly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard