Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeffreymorganio/improve-html-heading-layout
Ensure HTML elements wrap two words to the next line rather than one.
https://github.com/jeffreymorganio/improve-html-heading-layout
Last synced: 6 days ago
JSON representation
Ensure HTML elements wrap two words to the next line rather than one.
- Host: GitHub
- URL: https://github.com/jeffreymorganio/improve-html-heading-layout
- Owner: jeffreymorganio
- License: mit
- Created: 2012-02-29T10:03:08.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2015-02-23T09:00:18.000Z (almost 10 years ago)
- Last Synced: 2023-03-22T19:55:53.348Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://usabilityetc.com/2010/07/improve-html-heading-layout-with-jquery/
- Size: 137 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# join-last-two-words.js
## About
The joinLastTwoWordsOfElement function uses jQuery to replace the last space character in the selected HTML elements with the non-breaking space entity (` `).
## Example
An example use is ensuring that blogs don't put the last word of an entry title on a separate line. For example:
Bad:
How to Improve HTML Heading Layout with
jQueryGood:
How to Improve HTML Heading Layout
with jQueryIf you have the following mark up:
How to Improve HTML Heading Layout with jQuery
you can ensure two words will wrap to the next line with the following call:
joinLastTwoWordsOfElement('h1');
See `test.html` for more examples.
## More Information
For more information, please read [How to Improve HTML Heading Layout with jQuery](http://usabilityetc.com/2010/07/improve-html-heading-layout-with-jquery/).