TIL ch
is a length unit in CSS. So if you want to limit something to roughly 50 characters and add an ellipsis at the end if there is overflow, you can do something like:
.className {
max-width: 50ch;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Leave a Reply