word-wrap in firefox

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.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

About Nilesh Manohar

Web Developer
This entry was posted in General, HTML/CSS. Bookmark the permalink.

2 Responses to word-wrap in firefox

  1. test user says:

    Thanks for the tip

  2. web developer says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>