Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

words break inside a DIV

Tags:

html

css

I am just like this guy https://stackoverflow.com/questions/20430641/word-break-issue-in-css

I am experiencing everything he said, I also tried all sort of things, but unfortunately nothing helped.

That question didn't have a helpful answer. So, I am posting it again.

I am using codeigniter and this is how I echo my paragraph:

<div class="review-content">

  <p><?php echo $review->content ; ?></p>

</div>

The output would like this:

 A very clean hotel with a great st
 aff and very helpful. The restaura
 nt is classic but the food is very
like image 846
Che Jug Avatar asked May 03 '26 03:05

Che Jug


1 Answers

You need to use word-break

div {
    width: 210px;
    word-break: break-all; /* this is probably set somewhere in your code */
    background: #f5f5f5;
}

div.no-break {
    word-break: normal;
}

Demo

like image 172
Kevin Jantzer Avatar answered May 05 '26 18:05

Kevin Jantzer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!