user1100671 user1100671 - 3 months ago 10
CSS Question

Automatic line-break doesn't work?

I declared

width
and
margins
but somehow my lines didn't get wrapped with an automatic line-break.

enter image description here

edit:
I found the cause. It's because there is no space between words:

teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest teest 

Answer

The element where text is should have css declaration:

div {
    display: block;
    width: 200px; /*based on how much width this div should have*/
}

and if it doesn't work try doing:

div { word-wrap: break-word }