tags:

views:

129

answers:

1

I just found the <wbr> element (link) which basically lets specific an area where a break could apply if needed.

Basically I'd like to implement it in my apps, to prevent breaking the layout due a comment in a blog with too many letters or signs.

The problem is: it has to be HTML compatible, so averylongmadeupandunnecesaryunspacedword might break apart each 25 characters but it won't break a link <a href="http://www.google.com/search?hl=en&amp;source=hp&amp;q=averylongandunnecesarywordingoogle&amp;aq=f&amp;aql=&amp;aqi=&amp;oq="&gt;link&lt;/a&gt;.

+2  A: 

Have you considered using CSS? The word-wrap property is supported in IE, Safari, and FireFox 3.5

/* example */
.comments { word-wrap: break-word }

Also, <wbr> isn't supported on IE8 :(

Owen
You're right. Thanks sir.
metrobalderas