Spliting Text Nicely over Multiple Lines (i.e. for titles)
<p>I'm fighting over a way to have text wrap nicely to fit into set div boxes. Browsers wrap the text if it's too long to fit on one line which is expected, but this can often lead to rather nasty looking presentation.</p>

<p>For example, this looks fine:</p>

<pre><code>This is the title
</code></pre>

<p>But if I have a longer title, it may end up wrapped like this:</p>

<pre><code>This is a slightly longer
title
</code></pre>

<p>As you can see the second one doesn't really look very nice, what I'm aiming for is something like this:</p>

<pre><code>This is a nicer
wrapped title
</code></pre>

<p>I know how big the containing DIV will be, so that's not a problematic variable, but I'm trying to wrap my mind around all the possible ways of achieving nicely formatted titles and their flaws. So the question is, what would be the best way of doing this? I can think of a few ways, but they start to get exponentially more complicated if it wraps over more than 2 lines.</p>

<p>EDIT:
I'm currently using this - <a href="https://xnode.org/paste/19" rel="nofollow">https://xnode.org/paste/19</a> - to try and even out the split lines, although I'm sure it's far from perfect.</p>
