InDesign has a feature for paragraph styles; Balance Ragged Lines.
This is a very useful style attribute, because text in headings can look very uncomfortable if left to break naturally.
Unfortunatately there is nothing currently in CSS that gives us the power to balance our lines of text. I was always dissapointed to find that my eBooks did not mirror the settings in InDesign, and I was always resigned to the fact that text would break in a heading and then leave, possibly just one word on the following line.
But then I came across a post on the Adobe Web Platform blog.