Ensure that your content never has an orphan word on the last line
https://codepen.io/hdavtian/pen/ZJZqmW
<p class="my-paragraph">Try resizing your browser window and see if you can get this paragraph to end with a single word on the very last line.</p>
$('.my-paragraph').fixorphan({
numLastWords: 3
});
.nowrap {
white-space: nowrap;
}
<p class="my-paragraph">
Try resizing your browser window and
see if you can get this paragraph to
end with a single word on the
<span class="nowrap">
very last line.
</span>
</p>
- Include fixorphan library after jquery
- Include fixorphan css (or include the classes in your own css)
- Target desired DOM element in your markup and call .fixorphan()