Roman Veselý Software Engineer from Slovakia. Somewhere between trees and bytes of code.

Log #0042

It’s possible to limit the number of lines in a block element with -webkit-line-clamp CSS property. Although, it must be accompained with some additional properties to work:

p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

Browser support is sufficient. In the future, it might be replaced with line-clamp property.