3

How do i make a text wrap inside a div so that even one long word will be wrapped not only nicely spaced words? do i need js to do this?

denniss
  • 16,429
  • 26
  • 87
  • 138
  • Does this answer your question? [How to word wrap text in HTML?](https://stackoverflow.com/questions/1147877/how-to-word-wrap-text-in-html) – luke May 18 '20 at 06:46

3 Answers3

3
<div style=”word-wrap: break-word”>Here is some content for the div element</div> 

found similar question: How to word wrap text in HTML?

References:

http://www.css3.com/css-word-wrap/

http://www.1keydata.com/css-tutorial/wrap.php

http://bytes.com/topic/html-css/answers/627827-how-wrap-text-css

Community
  • 1
  • 1
Dr. Rajesh Rolen
  • 13,643
  • 39
  • 101
  • 175
0

using css you can achieve

word-wrap:break-word

Style

div {
    word-wrap: break-word;
}

HTML

<div>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
Harish
  • 2,263
  • 4
  • 22
  • 28
0

you can use word-wrap: break-word; in your css for the div.

Sachin Shanbhag
  • 52,879
  • 11
  • 86
  • 103