word-wrap in firefox

 
0 Kudos
Don't
move!

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)

2 thoughts on “word-wrap in firefox

  1. nice, but the tag library breaks even the short words if the are at the edge of the div. Maybe a better solution would be to add only to certain words which are longer than specified number.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Comments are closed.