a {
word-wrap: break-word;
}
Works for a long text too:
p {
word-wrap: break-word;
}
Tested in IE6, IE7, Firefox, Safari, Chrome
Books, worksheets, templates, frameworks and other useful resources for Chief Technology Officers (CTOs), VPs of Engineering & Technology Directors
Mmmm… This solution not validate and doesn’t work w many browsers!
did you try:
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* IE 5.5+ */
It’s still not css validate but works w many browsers
CSS means Cascading style Sheet. This the language of web page design.
Max,
word-wrap: break-word;
works in Gecko 1.9.1/ Firefox 3.5. See
https://developer.mozilla.org/en/CSS/word-wrap
BTW, white-space: pre-wrap;
works since Gecko 1.9/ Firefox 3.0, -moz-pre-wrap is dropped. See
https://developer.mozilla.org/en/CSS/white-space
j.j.