0
0
Bootsrapmarkup~20 mins

Text wrapping and overflow in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Text Wrapping Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does Bootstrap handle text overflow with utility classes?
Which Bootstrap utility class will correctly truncate text with an ellipsis when it overflows its container?
Bootsrap
<div class="text-truncate" style="width: 150px;">This is a very long text that should be truncated.</div>
Atext-truncate
Btext-wrap
Ctext-break
Dtext-nowrap
Attempts:
2 left
💡 Hint
Look for the class that adds ellipsis when text is too long.
📝 Syntax
intermediate
2:00remaining
Which CSS property prevents text wrapping in Bootstrap?
Given the following HTML, which CSS property is applied by Bootstrap's text-nowrap class to prevent text from wrapping?
Bootsrap
<p class="text-nowrap">This text will not wrap to the next line.</p>
Aword-break: break-all;
Boverflow-wrap: break-word;
Ctext-overflow: ellipsis;
Dwhite-space: nowrap;
Attempts:
2 left
💡 Hint
Think about which property stops text from breaking to a new line.
rendering
advanced
2:00remaining
What will be the visual result of this Bootstrap text wrapping example?
Consider this HTML snippet:
<div class="text-break" style="width: 100px; border: 1px solid black;">Supercalifragilisticexpialidocious</div>

What will you see in the browser?
Bootsrap
<div class="text-break" style="width: 100px; border: 1px solid black;">Supercalifragilisticexpialidocious</div>
AThe long word breaks and wraps onto multiple lines inside the box.
BThe text overflows the box horizontally without wrapping.
CThe text is truncated with an ellipsis at the end.
DThe text is hidden completely due to overflow.
Attempts:
2 left
💡 Hint
The class text-break allows breaking inside words to wrap.
selector
advanced
2:00remaining
Which Bootstrap class combination ensures text wraps but does not overflow?
You want text inside a fixed-width container to wrap normally but never overflow outside the container. Which combination of Bootstrap classes achieves this?
Bootsrap
<div class="???" style="width: 200px; border: 1px solid #000;">This is a long text that should wrap properly inside the box without overflow.</div>
Atext-nowrap text-truncate
Btext-wrap text-truncate
Ctext-wrap
Dtext-nowrap
Attempts:
2 left
💡 Hint
Wrapping means breaking lines normally, no truncation or no nowrap.
accessibility
expert
3:00remaining
How to ensure accessible text truncation with Bootstrap?
You use text-truncate to shorten long text with ellipsis. What should you add to keep the full text accessible to screen readers and keyboard users?
Bootsrap
<div class="text-truncate" style="width: 150px;">This is a very long text that should be truncated.</div>
ANo additional attributes are needed; truncation is accessible by default.
BAdd <code>aria-label</code> with the full text to the div.
CUse <code>role="presentation"</code> to hide text from screen readers.
DAdd <code>tabindex="-1"</code> to prevent keyboard focus.
Attempts:
2 left
💡 Hint
Think about how to provide full text to assistive technologies when visible text is cut off.