¿Se puede truncar un párrafo, y sólo dejar un determinado número de carácteres? Estoy haciendo un blog y quiero que en la vista solo se vea un poco del contenido real, es decir, que se trunque.
Por ejemplo, para el texto:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Quiero que muestre:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book...
Creo que se hace con Javascript
o con JQuery
Tengo este código:
<div class="card">
<div class="image">
<img src="images/<?php echo $row['articlePic']; ?>" alt="" width="300px" height="150px">
</div>
<div class="separator">
</div>
<div class="title">
<h3><?php echo $title; ?></h3>
</div>
<!------Parrafo a truncar------------->
<div class="content">
<p><?php echo $content; ?>
</p>
</div>
<div class="readmorebutton">
<p>Ver más <i class="fas fa-chevron-right"></i></p>
</div>
</div>