Complete the code to truncate the text with an ellipsis when it overflows.
<div class="w-48 [1]">This is a very long text that should be truncated.</div>
The truncate class in Tailwind applies overflow-hidden, whitespace-nowrap, and text-overflow: ellipsis to truncate overflowing text with an ellipsis.
Complete the code to prevent the text from wrapping to the next line.
<p class="[1] w-64">This text should stay on one line and overflow if too long.</p>
The whitespace-nowrap class prevents text from wrapping to the next line, keeping it on a single line.
Fix the error in the code to correctly truncate the text with ellipsis.
<span class="w-40 whitespace-normal [1]">This text should be truncated but it is wrapping instead.</span>
The truncate class applies overflow-hidden, whitespace-nowrap, and text-overflow: ellipsis. Using whitespace-normal allows wrapping, so replacing it with truncate fixes the issue.
Fill both blanks to create a box that truncates text with ellipsis and prevents wrapping.
<div class="w-56 [1] [2]">This is a long text that should be truncated with ellipsis.</div>
To truncate text manually, you need overflow-hidden to hide overflow and whitespace-nowrap to prevent wrapping. The truncate class combines these but here we fill them separately.
Fill all three blanks to create a responsive truncated text box with ellipsis that never wraps.
<p class="[1] [2] max-w-xs [3]">This paragraph will truncate text with ellipsis on small screens.</p>
The truncate class (BLANK_1) applies overflow-hidden and whitespace-nowrap internally, but here we add them explicitly (BLANK_2 and BLANK_3) to emphasize the effect. max-w-xs limits width for responsiveness.