0

I have a long text to put in a DIV , it does not wrap and all of the text is displayed in one line .

tried every CSS i know from word-wrap to white-space but nothing works .

if the text contained a \n or , or . it wraps .

Any idea on how to wrap it even if none of these existed ? without using the width in css

Thank you .

Rami Dabain
  • 4,581
  • 12
  • 59
  • 104
  • possible duplicate of [wordwrap a very long string](http://stackoverflow.com/questions/856307/wordwrap-a-very-long-string) – Alin Purcaru Mar 29 '11 at 15:38

3 Answers3

1

Previously answered:

wordwrap a very long string

Community
  • 1
  • 1
Jollymorphic
  • 3,470
  • 15
  • 16
1

The short answer to this is the css property word-wrap: break-word.

See wordwrap a very long string for more details.

Community
  • 1
  • 1
Ian Pugsley
  • 1,062
  • 8
  • 20
0

Try it like this:

white-space: normal;
word-wrap: break-word;
Alin Purcaru
  • 42,085
  • 12
  • 75
  • 90