writing‑mode Demonstrator - Online Vertical Text
Display text in horizontal‑tb, vertical‑rl, vertical‑lr. See how block and inline directions switch. For multilingual sites.
UD5 Toolkit
Generate CSS for truncating text after N lines with optional expand/collapse functionality.
line-clamp is a CSS technique that truncates multi-line text after a specified number of lines, appending an ellipsis (…) at the cutoff point. It works by combining four key properties:
display: -webkit-box — sets the element as a flexbox container in the block direction-webkit-box-orient: vertical — arranges children verticallyoverflow: hidden — hides content beyond the container-webkit-line-clamp: N — limits the visible lines to NThe -webkit- prefix is historical but now supported across all modern browsers including Chrome, Edge, Firefox (68+), and Safari.
Yes, it is very safe. As of 2024, -webkit-line-clamp is supported by all major browsers:
Global browser support exceeds 98%. The standard line-clamp property (without prefix) is also emerging in the CSS Overflow Level 3 spec. For maximum compatibility, include both prefixed and unprefixed versions in your CSS.
text-overflow: ellipsis only works on single-line text in combination with white-space: nowrap and overflow: hidden. It truncates one line and adds an ellipsis.
-webkit-line-clamp handles multi-line truncation — you specify exactly how many lines to show before the ellipsis appears. It is far more flexible for cards, blog excerpts, product descriptions, and any content where you need to limit visible lines to more than one.
Rule of thumb: Use text-overflow for single-line truncation (headlines, labels, table cells). Use line-clamp for multi-line truncation (descriptions, excerpts, comments).
Browser-native -webkit-line-clamp always renders "…" (or "..." depending on the browser). To use a custom symbol, you have two options:
::after pseudo-element with your custom symbol at the bottom-right corner of the container, with a gradient background to fade out the text beneath it.For most use cases, the standard ellipsis is perfectly fine and widely recognized by users.
Yes, search engines can read all the text. -webkit-line-clamp only visually truncates content using CSS — the full text remains in the DOM. Search engine crawlers parse the HTML, not the rendered CSS. So:
This makes line-clamp far superior to JavaScript-based truncation that removes text from the DOM, or server-side truncation that literally cuts content before sending it to the browser.
Both approaches have their merits:
| Approach | Pros | Cons |
|---|---|---|
| Pure CSS (checkbox hack) |
No JavaScript required; works even with JS disabled; lightweight | Slightly hacky DOM structure; checkbox state is not accessible; no smooth animation |
| JavaScript (class toggle) |
Cleaner HTML; supports smooth transitions; more flexible; better accessibility | Requires JS; slightly more code; needs event listener setup |
For modern projects, the JavaScript approach is generally recommended for its flexibility and cleaner markup. Use Pure CSS if you need a zero-JS fallback.
Direct height animation with line-clamp is tricky because -webkit-line-clamp doesn't expose a transitionable value. However, you can create smooth expand/collapse effects using:
max-height on the clamped state and transition to a larger max-height when expanded (e.g., max-height: 4.5em → max-height: 1000px).grid-template-rows transition to smoothly animate between collapsed and expanded states.requestAnimationFrame or the Web Animations API.The generated JavaScript code in this tool includes a basic transition setup that you can enhance with these techniques.
Display text in horizontal‑tb, vertical‑rl, vertical‑lr. See how block and inline directions switch. For multilingual sites.
Create a 3D extruded text effect using multiple text‑shadows. Adjust depth, color, and perspective. Ready‑to‑use CSS.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Convert any text to upside down (flipped) characters using Unicode mappings. Copy and paste to social media. 100% local, no data sent.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Format your text into a classic newspaper layout with multiple justified columns. Ready to print or PDF. Local.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Drop a PDF and count the total words, characters, and pages. Text extraction is done locally. Privacy‑friendly.
Add a repeating diagonal text watermark to your images. Adjust opacity, font, and color. Protect your photos locally.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Turn a photo into a high‑contrast ASCII art using only standard text characters. Adjust brightness and character set. Works offline.
Paste a sentence and see each word tagged with its part of speech (noun, verb, adjective). Local rule‑based analysis.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Paste text and see a sorted count of all emojis used. Find your most‑used emoji. Fun analytics. All local.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Upload multiple text files and concatenate them into one, with optional separators. No upload; processed instantly.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Extract selectable text from a PDF using the browser's built‑in PDF rendering. Copy or download as TXT. No upload, fully private.
Enter Braille dot numbers (1‑6) or paste Unicode Braille to decode into English text. Companion to text‑to‑Braille.
Generate a QR code with a custom text label below or above. Perfect for printed signs. All generated locally as a single image.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Write upside down text using Unicode flipped characters. Copy and paste to surprise friends. Completely frontend and instant.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Deep-dive into text with detailed character and letter frequency analysis. Supports multiple languages and includes whitespace control. Fast and private.
Count words, characters, sentences, and paragraphs instantly. Analyze text density and reading time. Secure client-side processing for your content privacy.