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
  • 21,638
  • 45
  • 111
  • 152

5 Answers5

2

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

Tim
  • 6,986
  • 8
  • 38
  • 57
1

Try:

div {

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

}

and also set a fixed width on the div.

Tim
  • 6,986
  • 8
  • 38
  • 57
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
  • 65,599
  • 28
  • 144
  • 152
0

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

Tgr
  • 27,442
  • 12
  • 81
  • 118
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