Menu
CoddyTech

Readable Long Tokens

Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 34 of 55.

Some content must remain fully visible even when it contains a long word, URL or reference without convenient spaces. wrap-anywhere permits emergency breaks and includes those opportunities when calculating minimum-content size. It keeps the characters in the document.

<p class="w-40 wrap-anywhere whitespace-normal">archive_reference_abcdefghijklmnopqrstuvwxyz</p>

The example wraps a long archive identifier inside a narrow region. Keep whitespace-normal and visible overflow so the text can form additional lines. This differs from truncate, which intentionally hides part of a one-line preview.

Use the policy that matches the content’s purpose. A filename summary may be truncated with a path to the full item, while a confirmation reference may need every character immediately visible. In a mixed flex row, combine wrapping with a shrinkable text region and protected fixed siblings.

challenge icon

Challenge

Medium

Keep the complete reference visible within its 192px card. Allow breaks anywhere when needed, using normal white-space and visible overflow rather than clipping or ellipsis. Preserve every character.

Preserve the supplied content, semantic elements and IDs. Edit the requested utility classes. Press Run preview after edits, then Check/Run code to grade the result. Supplied JavaScript is read-only.

Try it yourself

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<article class="w-48"><h2>Reference</h2><p id="reference" class="whitespace-nowrap">workshop_registration_confirmation_reference_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</p></article>
</body></html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Responsive UI Patterns