开发者

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,开发者_StackOverflow中文版 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?


  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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜