This snippet shortens overflowing text by clamping it after a set number of lines and adding an ellipsis (…) at the end. It keeps long content tidy and maintains clean layouts without breaking design consistency.
Add this code with a snippets plugin in <head>, or place it in Element CSS, Page CSS block, or Site Settings. Apply the .ou-multiline-break custom class on any element where you want multi-line ellipsis.
.ou-multiline-break {
display: -webkit-box;
-webkit-line-clamp: 3; /* number of lines */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
Add this code inside the Custom CSS field of an element in Elementor. The selector tag automatically targets only that specific element, so the style won’t affect others.
selector {
display: -webkit-box;
-webkit-line-clamp: 1; /* number of lines */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
Some solutions only work on the live site. Always publish and test after each change, as results may not appear in the editor.