开发者

word wrap long character string inside div tag

开发者 https://www.devze.com 2023-04-12 06:01 出处:网络
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 开发者_如何学JAVAwill wrap a long word.What\'s the easiest way to do t

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 开发者_如何学JAVAwill wrap a long word. What's the easiest way to do this with CSS and PHP?


apply the below class to div

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号