Tuesday 23 November 2010

Wrapping using css. Multiplatform.

.wrap

{
word-wrap:break-word;
-ms-word-wrap:break-word;
break-word: break-all;
overflow: hidden;
}


div class="wrap" style="-ms-word-wrap: break-word; width: 100px;"


If you want your text to be inside a table then you need to have a div in the cell and set the width to be the same in both:

div class="wrap" style="-ms-word-wrap: break-word; width: 100px;"


I use a css class to specify these widths so I only have to set the width in one place.