For one line there is text-overflow. For a teaser of exactly three lines with dots at the end, the tool is line-clamp, in its prefixed form.
.excerpt {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
It looks like legacy code, and partly it is: the old -webkit-box display mode is required for the clamp to work. But this exact combination is what every current browser supports, including Firefox since version 68. The text stops after the third line and the last visible line ends in an ellipsis.
I like it for post excerpts in a card grid, so one long summary does not make its card taller than the rest.
The unprefixed line-clamp property exists in the spec, but according to MDN it is only in preview builds and behind flags right now, so do not use it on its own yet.
Two things to watch. The hidden text is still in the page, so screen readers read all of it, which is usually fine but worth knowing. And if the element has padding at the bottom, a fourth line can peek through, so put the padding on a wrapper instead.
Further reading: MDN: line-clamp