corbyboy — 2010-10-01T05:12:12-04:00 — #1
Is there a way using CSS to force a string to wrap onto a new line mid-word when it reaches the edge of a container.
It sounds pretty simple in theory but I can't find any way to do this.
corbyboy — 2010-10-01T10:12:18-04:00 — #2
Thanks a lot for the help. That's exactly what I needed.
stevie_d — 2010-10-01T07:35:47-04:00 — #3
I don't think it's actually an official part of CSS so it might not work everywhere, but it seems to be pretty well supported by most browsers.
paulob — 2010-10-01T07:59:38-04:00 — #4
Yes word-break:break-word is part of cSS3 and has been implemented in IE since about IE5 IIRC.
The latest webkit, Firefox and opera all support it now.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
In tables IE usually needs a wrapper in the table-cell to have the word wrap applied to and Firefox needs the table to be table-layout:fixed.