can I adjust if the text reaches the certain number of characters go to the next line? (Html/css/php)

Issue

how can I adjust if the text reaches the ceiling or at least a certain number of characters go to the next line?
I mean I have a div but my text(I get it from mysql) is a little longer than my page and a scrollbar will show but I want the text to go to the next line

I tested this code :

<div class="info">
<?php
$strec = $row["text"];
if (strlen($row["text"]) >= 980) {
   $strec = str_replace(" ", "\n", $row["text"]);
}
?>
<p><?=$strec?></p>
</div>

But it didn’t work

Solution

look for something like white-space: nowrap in your css and if you find it, remove it (maybe it is in your div)

Answered By – Exploded Developer

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published