A very long product title that must not break the card layout
Text ends with … when it overflows.
If you searched text-overflow ellipsis or line clamp css, single-line truncation uses overflow hidden plus ellipsis; multiline uses line-clamp with a flex/grid-friendly pattern.
Classic one-line truncation in narrow columns.
A very long product title that must not break the card layout
Text ends with … when it overflows.
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}Limit to N lines with ellipsis at the end.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.
Clamped to three lines.
.clamp {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}Prevent layout blowout from unbroken strings.
https://example.com/very/long/path/that/wraps
overflow-wrap: anywhere breaks long tokens.
.break {
overflow-wrap: anywhere;
word-break: break-word;
}