Line-clamp truncates text at a specific number of lines.
https://css-tricks.com/almanac/properties/l/line-clamp/
Great to make the inner content of blog items in the Divi blog module the same length.
Copy the following in the free form css box of the blog module.
- The min-height is to ensure that blog items with less lines also gets the same height (= clamp value * line height)
- Margin-bottom is to give space between content and read more link
selector .post-content-inner {
line-clamp: 6;
display: -webkit-box;
-webkit-line-clamp: 6;
-webkit-box-orient: vertical;
overflow: hidden;
min-height: 10.2em;
}
selector .post-content-inner{
margin-bottom: 1em;
}Code language: CSS (css)