user978905
user978905

Reputation: 5527

word wrap long character string inside div tag

I have a DIV container I'm using as a comment box. I want to make sure that text doesn't overflow the DIV container, and instead will wrap a long word. What's the easiest way to do this with CSS and PHP?

Upvotes: 0

Views: 1005

Answers (2)

Punit
Punit

Reputation: 1120

define white-space:normal; as css property to div to fit text in box and to break word is word-wrap:break-word;

Upvotes: 0

Amila
Amila

Reputation: 1423

apply the below class to div

.break-word {
  word-wrap: break-word;
}

Upvotes: 1

Related Questions