Skip to content
Advertisement

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

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

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement