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.
Transform normal text into vaporwave fullwidth Aesthetic characters. Includes zalgo and other styles. Copy ready for social posts. Local tool.
Create color gradients that are perceptually uniform by interpolating in CIELAB space. Get the CSS linear‑gradient code. Visually superior.
Create CSS `easing‑gradient()` functions for smooth, non‑linear color transitions. Experimental and powerful. Copy the code.
Compare text‑rendering: auto, optimizeSpeed, optimizeLegibility, geometricPrecision. See kerning and ligature changes live.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
Build a multi‑layer text‑shadow to simulate 3D extruded text. Control depth, color, and direction. Copy long shadow CSS.
Stack multiple text‑shadows to create a blurred, glowing gradient effect. Copy the long‑shadow CSS instantly.
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.
Change text orientation within vertical writing mode. See mixed, upright, sideways. Useful for CJK layout.
Visually create beautiful linear and radial gradients. Get the CSS code instantly. Copy the code or export as image. Perfect for web designers.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Place bold text over an image and apply mix‑blend‑mode: screen, multiply, etc. Create stunning hero sections. Download preview.
Design a responsive navigation bar with a pure CSS hamburger menu. Customize colors and breakpoints. Copy the code.
Build a 3D rotating cube using pure CSS. Set dimensions, colors, and animation speed. Copy the HTML and CSS.
Generate a unique, beautiful random gradient background with each click. Copy the CSS code. Endless inspiration.
Animate text that looks like it's being decoded or scrambled before settling on the final word. Copy the JS snippet.
Detect browser support for font‑tech() and font‑format() values in @font‑face src. Check COLRv1, variable, etc.
One click random beautiful gradient backgrounds with copy‑ready CSS. See full‑screen preview. Never run out of background ideas.
Get a random pickup line ranging from smooth to ridiculously cheesy. Perfect for breaking the ice or cringe laughs.
Convert any text to upside down (flipped) characters using Unicode mappings. Copy and paste to social media. 100% local, no data sent.
Encode a hidden message using zero‑width characters. The message looks like normal text. Decode with the same tool.
Generate a random, somewhat meaningful song lyric line. Write your own hit with AI‑free randomness. All local.
Type text and convert each letter into vector SVG paths. Perfect for logos and animations. Canvas‑based.
Strip HTML tags and convert web content to plain Markdown. Preserve headings, lists, and links. Perfect for content migration. All processing in browser.
Layer gradients and images and blend them with background‑blend‑mode. Create hero sections. Copy CSS.
Paste or write a CSS gradient value and instantly see the rendered output. Debug and iterate on gradients quickly. Local preview.