title: Efficient way to limit the characters of paragraph (Vertical text-overflow)
body: <p>I'm trying to Create Blog page and thinking about best way to limit the length of the main content? (description under thumbnails)</p>
  
  <p>I'm doing this with jQuery, but I'm looking for a common way that developers do it.</p>
  
  <p>or I can limit it with php in backend.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery(document).ready(function ($) {
      // text limiter
      function textLimit(elements,maxTextLength) {
          for (var i = 0; i &lt; elements.length; i++){
              if (elements[i].innerHTML.length &gt; maxTextLength)
              elements[i].innerHTML = elements[i].innerHTML.slice(0,maxTextLength) + '...';
          }
      }
      
      textLimit($('.content').find('p'),200);
      
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>div.content {
    width: 300px;
    height: 300px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="content"&gt;
      &lt;a&gt;&lt;h4&gt;New Product&lt;/h4&gt;&lt;/a&gt;
      &lt;p&gt;Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original.&lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>thanks.</p>