3

I used the below word-wrap in a div, but it does not seem to work at all. Any alternatives.

word-wrap: break-word;

This is CSS 3, how about CSS 2 Thanks Jean

X10nD
  • 20,888
  • 44
  • 108
  • 152

5 Answers5

2

This is a CSS3 attribute, so make sure that your/the visitors browser supports CSS3.

Tim
  • 6,838
  • 8
  • 35
  • 55
1

Try:

div {

text-align: justify;
white-space: normal !important;

}

and also set a fixed width on the div.

Tim
  • 6,838
  • 8
  • 35
  • 55
0

Try:

div.mydiv 
{
    white-space: normal;
}

Above doesn't work.

FF does not support this CSS3 selector as documented here Mozilla.org forum. and Mozilla bug report

Try using overflows or use

text-align:justify;
Kyle
  • 63,222
  • 27
  • 141
  • 151
0

Firefox only supports word-wrap from 3.5 (see doc). You can use white-space (doc) for backwards compatibility.

Tgr
  • 26,444
  • 11
  • 80
  • 113
0
.mydiv1 {
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;}

.mydiv2 {
word-break: break-all;}

At class mydiv1 is a combination of 'word-break: break-all' and 'word-wrap: break-word'. While at class mydiv2 only 'word-break: break-all'.

Sentrapedagang.com

Dewa Putra
  • 15
  • 3