sof_user
sof_user

Reputation: 709

word-wrap doesn't work for all words (?!)

i used

word-wrap: break-word;
text-align:justify;

for a div. If a single word is so long that the div width can't fit it even if the word is placed in the next line, then the word is wrapped i.e. broken in lines. But if a second word with width less than or equal to the div width appears after a first word and the div width cannot fit the second word then the second word is placed in the next line. But I also need the second word to be wrapped while it sits by the first word. How can I do that ? Isn't the word-wrap property supposed to work for my later instance too?

Any solution?

Upvotes: 0

Views: 322

Answers (1)

BGerrissen
BGerrissen

Reputation: 21680

  1. Word-wrap is a IE invention and became part of the CSS3 specification, as such a lot of browser (versions) don't support it.

  2. Implementations of CSS word-wrap will most likely vary cross-browser, even in IE.

  3. It's better not to rely on CSS word-wrap just yet, the design must accomodate long words if applicable.

There is no straight forward solution possible and one can only wait till CSS word-wrap is properly supported and implemented. Until then, make design accomodate long words.

Upvotes: 1

Related Questions