Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You do not need to assign a hard-coded width such as 200px to create a one-line ellipsis. Give the text a real boundary from its responsive layout—remaining space in a flex row, a flexible grid track, or a constrained parent—then apply overflow: hidden, white-space: nowrap, and text-overflow: ellipsis. The element must also be allowed to shrink, commonly with min-inline-size: 0.

This distinction matters: text-overflow changes how already-hidden inline overflow is displayed; it does not choose a width or force overflow by itself.

The essential one-line pattern

Use this when the element is already constrained by its parent:

.title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

The parent must supply a smaller available inline size than the untruncated text. That size can change with the viewport, neighboring controls, a responsive column, or the content of the surrounding layout. No fixed pixel width is required, but some boundary is required. If every ancestor can expand indefinitely, the text never overflows and no ellipsis appears.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

What each declaration does

  • overflow: hidden clips content outside the box.
  • white-space: nowrap keeps the text on one line.
  • text-overflow: ellipsis replaces the clipped end with an ellipsis when the inline content overflows.

Removing any one of these usually changes the result: the line may wrap, the excess may remain visible, or it may be clipped without the ellipsis.

Let a flex layout provide the width

A flex row is the usual solution when a title should consume whatever space remains beside an icon, button, badge, or other fixed-size control.

.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title {
  flex: 1 1 auto;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.icon {
  flex: none;
}

flex: 1 1 auto lets the title take available space and shrink when the row becomes narrower. The icon remains at its intrinsic size. min-inline-size: 0 is the logical-direction form of min-width: 0; it overrides the flex item’s automatic minimum that can otherwise preserve the text’s min-content size.

Why min-inline-size: 0 is often the missing rule

Flex and grid sizing account for intrinsic content dimensions. A long unbreakable word can make the text’s minimum size large enough to prevent the item from becoming narrow. In that situation, the ellipsis declarations are present but the text box never reaches an overflowing size. Put the zero minimum on the flex item that must shrink. With nested flex rows, an intermediate flex item may also need the rule.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a flexible grid track

Grid works well when the text belongs in one column and a control belongs in another. Make the text track explicitly able to shrink:

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.title {
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

minmax(0, 1fr) changes the flexible track’s minimum from its content-based minimum to zero. The second, auto, column can remain sized to a button or icon while the first column receives the remaining space.

When a simple parent is enough

If a block is inside a responsive column whose computed inline size is already smaller than its text, do not add unnecessary flex or grid. The three-line truncation rule is sufficient. Simpler layout means fewer intrinsic-sizing interactions to debug.

A reliable debugging sequence

  1. Inspect the text element. Verify that its computed styles include overflow: hidden, white-space: nowrap, and text-overflow: ellipsis.
  2. Check the computed size. The element or a relevant ancestor must have an inline size smaller than the untruncated line. In browser developer tools, compare the box dimensions with the full text and watch them while resizing the viewport.
  3. Find the item that refuses to shrink. In flex layouts, add min-width: 0 or min-inline-size: 0 to the flex item containing the text. In a nested layout, inspect each parent from the text outward.
  4. Inspect grid track minimums. Replace a plain 1fr track with minmax(0, 1fr) when the track’s intrinsic minimum is blocking shrinkage.
  5. Account for everything consuming space. Padding, borders, gaps, icons, buttons, badges, and non-shrinking siblings reduce the space available to the title.
  6. Test the shortest and longest cases. A short label should remain unchanged; a long string and a long unbroken token should visibly truncate at narrow widths.

Common layouts and failure modes

The parent grows instead of constraining the child

If the row itself is allowed to grow to fit the content, there is no overflow. Place the row in a responsive container, a column with a real limit, or a flex/grid context that allocates remaining space. “No fixed width” does not mean “no constraint anywhere.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An ancestor has an automatic minimum

Adding min-inline-size: 0 only to the innermost span may not help if its parent is another flex item retaining the text’s intrinsic width. Apply the zero minimum at the layout boundary that needs to shrink, then recheck computed widths.

A long URL or token breaks the layout

Unbreakable content raises the min-content size. The flex and grid patterns above handle this by allowing the relevant item or track to shrink. Keep overflow: hidden on the truncating box so the token cannot paint outside it.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Padding makes the ellipsis appear too early

The content box is smaller than the border box when padding is present. Include padding and borders in your space calculation, and make sure adjacent controls have the intended fixed or flexible behavior.

One line is not the same as multiple lines

The established recipe is for a single line. text-overflow addresses overflow in the inline progression direction; it does not place an ellipsis at the bottom of a multi-line block. For a multi-line summary, use a line-clamping technique that matches your browser-support requirements and verify its current behavior in your target browsers. The CSS Overflow Editor’s Draft describes block-overflow ellipsis behavior, but it is a living draft rather than a guarantee of uniform support for every multiline feature.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not switch to multiline markup simply because a fixed width is undesirable. A fluid card, responsive grid column, or flex allocation can provide the boundary while the line-clamp implementation controls the number of lines.

Direction, writing mode, and editable controls

Left-to-right and right-to-left text

With one text-overflow value, the ellipsis is placed at the end of the line’s inline progression: normally the right side in left-to-right text and the left side in right-to-left text. The property also accepts separate values for the two ends when a design needs different treatment. Test mixed-direction content rather than assuming the visual edge is always the right edge.

Inputs, textareas, and contenteditable elements

Editable controls do not always render ellipses like static text. Browser behavior can use clipping instead, either consistently or while the control is focused. Verify the actual input, textarea, or contenteditable behavior in each supported browser and provide another way to view or edit the complete value when truncation would hide important information.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Accessibility and disclosure

Keep the full string in the document and choose a disclosure pattern appropriate to the interface: a visible expansion, a details panel, or a clearly associated accessible name. Do not rely on a hover-only tooltip for information that keyboard or touch users must reach. Truncation is a visual presentation choice, not permission to remove the underlying content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Complete responsive example

This example has no fixed title width. The card allocates the remaining space between a flexible title and a non-shrinking action button.

<article class='card'>
  <div class='card-row'>
    <h2 class='card-title'>A very long project name that should remain on one line</h2>
    <button class='card-action' type='button'>Open</button>
  </div>
</article>
.card {
  max-inline-size: 100%;
  padding: 1rem;
  border: 1px solid #d8d8d8;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-inline-size: 0;
}

.card-title {
  flex: 1 1 auto;
  min-inline-size: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-action {
  flex: none;
}

The card can become as wide as its containing layout permits. The title receives whatever space remains after the button, and the title’s minimum is explicitly zero so the button does not force horizontal overflow.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance and reliability considerations

Ellipsis itself is inexpensive: it is a paint-time treatment of inline overflow. Most layout cost comes from the surrounding flex or grid recalculation when content or viewport dimensions change. Avoid repeatedly measuring text in JavaScript merely to decide whether to show an ellipsis; let CSS perform the layout, and use script only when the product genuinely needs a disclosure control based on measured overflow.

For reliable results, test at narrow and wide viewport sizes, with localization strings, long unbroken identifiers, increased text size, right-to-left content, and keyboard focus. Confirm that buttons and icons remain reachable and that clipped text is not the only way users can discover a critical value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Troubleshooting checklist

  • No ellipsis, text wraps: add white-space: nowrap.
  • No ellipsis, text remains visible outside the box: add overflow: hidden (or another deliberate overflow value).
  • No ellipsis, but all declarations are present: prove that the computed inline size is smaller than the text; text-overflow cannot create overflow.
  • Flex row overflows horizontally: set min-inline-size: 0 on the shrinking flex item, and inspect nested flex parents.
  • Grid column refuses to narrow: use minmax(0, 1fr) for the flexible track and set a zero minimum on the text item.
  • Only focused inputs lose the ellipsis: treat this as editable-control behavior, not proof that the static-text CSS is wrong; test a separate disclosure design.
  • Ellipsis appears on the unexpected side: check direction and writing mode; placement follows inline progression.

Or skip the browser setup

If you need a rendered image of a page to verify how a responsive ellipsis behaves across states, ScreenshotNeo can capture the URL through one request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

Use the API documentation at https://screenshotneo.com/docs/ for authentication and options. A direct capture looks like this:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo includes full-page capture with lazy images loaded, CSS-selector element capture, device presets and custom viewports, retina scale, custom CSS and JavaScript, waits for selectors or network idle, request and resource blocking, cookies and headers, timezone and geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous jobs, bulk capture of up to 100 URLs per call, usage reporting, and an OpenAPI specification. Its plans include 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000 screenshots, and every feature is available on every plan. Create a free ScreenshotNeo account.

Frequently Asked Questions

Can I use only `text-overflow: ellipsis`?

No. It only changes the rendering of inline overflow; combine it with a real constraint, no wrapping, and overflow handling.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is `min-width: 0` still valid?

Yes. It is the physical equivalent for horizontal layouts; `min-inline-size: 0` follows the writing direction and is preferable when logical properties fit your browser support.

Why does a short string show no ellipsis?

An ellipsis appears only when the rendered line actually exceeds the available inline space. Short content remains unchanged.

Does this technique truncate HTML markup safely?

It truncates the rendered line visually. The complete text and inline elements remain in the document; it is not a string-slicing method.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.