To limit a div to a maximum of two rows of text in CSS, you can use the combination of line-clamp, display: -webkit-box, and other related properties. In this example I set the width to 50px for the div and line clamp is after 2 lines. This does require webkit, but is supported by modern browsers.
Source code viewer
<style> .text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; width: 50px; } </style> <div class="text"> This is a paragraph that will be limited to just two rows. It will be expanded with ellipsis. </div>Programming Language: HTML