/* CSS */ .short-description p { height: 3em; } /* JavaScript */ jQuery(document).ready(function($) { function shorten_text(selector) { $(selector).each(function() { var $elem = $(this); var wordArray = $elem.html().split(' '); while($elem.prop('scrollHeight') > $elem.prop('offsetHeight')) { wordArray.pop(); $elem.html(wordArray.join(' ') + '...'); } }); } shorten_text('.short-description p'); });