📎 Webclip
Truncate string with ellipsis
The page explains how to adjust long strings in one line and show ellipsis at the end. It uses CSS properties together, and suggests the title attribute to show the full string on hover.
Reading notes#
- text-overflow is used to show how hidden content appears when text is clipped
- white-space: nowrap keeps the text from wrapping
- overflow: hidden clips content inside a fixed width
- width sets the space available for the content
- title can show the full long string when the element is hovered
- in an input element, text-overflow: ellipsis can be used directly
