word-wrap in firefox

0 Kudos

Recently was faced the problem where the div was fixed length and it contained a very very long string. The long string was jutting out of the div. In order to overcome that first I modified the CSS and added overflow:hidden property to the div in question. Then the problem was that users were not able to see the entry properly. This was easily fixed for IE 6 and IE 7 by adding word-wrap:break-word to css. This property is not supported by firefox. The application was java based so could not use some already nice functions in other languages (e.g. wordwrap in php). To achieve this in java one must include a non printing character ( like <wbr/> ) after each character. This could be done easily by writing a method in Tag Library.

I have written that method in Tag Library and tested it. IT WORKS.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

19. January 2008 by Nilesh Manohar
Categories: General, HTML/CSS | 2 comments