title | date | submitter | number | tags | status | related | discussion | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
I want multi-line truncation via CSS |
2020-02-28 16:55:42 UTC |
Alexis Córdova |
5e59460efa695ea9f7750152 |
|
in-progress |
|
Single-line text truncation is easy, straightforward, and broadly supported in browsers; however, multi-line text truncation requires JavaScript, half-baked and non-standardized CSS properties, or fragile hacks to accomplish.
The closest attempt I've seen is the -webkit-line-clamp
approach:
.line-clamp {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}