Game of Thrones Bastard

Red bastards

A bastard (or an orphan as you say outside Sweden) is a problem that occurs when a word, part of a word, or a very short line appears by itself at the end of a paragraph. Since most text on the web is not static and probably even have a dynamic width you will very likely end up with this problem. This is how you make your editors happy by letting them slay some bastards.

No Wrap

You can set the CSS property ´white space´ to ´no-wrap´. This will make line to never wrap to a new line. But we can't add this to all paragraphs. Then we'd get some pretty long lines of paragraphs. So we'll have to make the editors and Umbraco work together. Begin with adding this to your CSS:

.no-wrap {
    white-space: nowrap;

If you don't already have a stylesheet for your richtext editor, go to Settings, right click on Stylesheets and create one. Right click your new stylesheet, create a new property and name it "No line break". Give it the Alias .no-wrap and put this in Styles;

white-space: nowrap;
border-bottom: 1px dashed #BADA55;

The editor will later be able to wrap words in this property. We give it a badass color so the editor can see where the lines won't wrap. This will only be seen in the Umbraco admin and not on your site.

Add your new stylesheet to your richtext editor by going to Developer -> Data Types -> Richtext editor and checking the stylesheet you just made under Stylesheets. Save and try it out!

Mark some text and choose the no wrapping format from the drop down. It will give it a dashed underline and not wrap it.

Bastard killed

You did it! You killed the bastard! Well done Olly!