Given a block container
<div>
this is a very long string which contains a bunch of characters that I want to break at container edges.
</div>
are there any css properties I can set to force it to break when it reaches the container width, regardless of the contents of the string, for example a break like:
this is a ve
ry long stri
ng which ...
is pretty much what I want. Right now, it seems to always prefer to break at whitespace characters or other special characters (such as /).
There’s a CSS3 property called
word-breakthat may be of some use to you in future.More information is available here: http://www.css3.com/css-word-break/
The
break-allvalue looks to do the thing you’re asking for:As for more supported versions of CSS, I don’t believe there’s a way you can do this.