🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Fixorphan.js is a jQuery plugin for modern web typography that prevents orphans at the end of a paragraph you specify.

Typography

Documentation

Fixorphan Jquery Plugin

Ensure that your content never has an orphan word on the last line

Sample Codepen demo

https://codepen.io/hdavtian/pen/ZJZqmW

The markup
<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>
The JS
$('.my-paragraph').fixorphan({     numLastWords: 3 });
The Css
.nowrap {     white-space: nowrap; }
Generated result
<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>

Getting Started

  • 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()

You May Also Like