Kerning
1015/)](https://imgs.xkcd.com/comics/kerning.png) > Kerning can refer to one of two things: spacing instructions that type designers put into font files to mitigate awkward character combinations, or spacing adjustments that graphic designers make as they typeset In this section we will only discuss the second definition of Kerning. We will cover both the built-in CSS kerning features and [Lettering.js](http://letteringjs.com/), a Javascript library that provides enhanced support for kerning and other formatting using CSS. The idea is to adjust the kerning without having to do any refactoring of the content. Automatic kerning in CSS depends on Open, particularly in the kerning attribute being enabled. This will change from font to font and is embedded in the font when created. \[codepen\_embed height="618" theme\_id="2039" slug\_hash="RPZrKv" default\_tab="result" user="caraya"\]See the Pen [Automatic Kerning](http://codepen.io/caraya/pen/RPZrKv/) by Carlos Araya ([@caraya](http://codepen.io/caraya)) on [CodePen](http://codepen.io).\[/codepen\_embed\] There may situations where you want a less uniform kerning based on specific attributes. We can control the kerning between letters, as in example 8-2, below. The first paragraph has normal kerning; the second paragraph has letters spaced 0.25em; and the third one has a negative kerning of 0.25em. \[codepen\_embed height="618" theme\_id="2039" slug\_hash="rVzxyz" default\_tab="result" user="caraya"\]See the Pen [Kerning using word spacing](http://codepen.io/caraya/pen/rVzxyz/) by Carlos Araya ([@caraya](http://codepen.io/caraya)) on [CodePen](http://codepen.io).\[/codepen\_embed\] Another way to work with kerning is to change letter spacing within words as in example 8-3. Notice the difference between the example above using word spacing and the one below using letter spacing: When we kern letters the text looks significantly different than when we work with words. \[codepen\_embed height="475" theme\_id="2039" slug\_hash="ZGJQjX" default\_tab="result" user="caraya"\]See the Pen [Kerning using letter spacing](http://codepen.io/caraya/pen/ZGJQjX/) by Carlos Araya ([@caraya](http://codepen.io/caraya)) on [CodePen](http://codepen.io).\[/codepen\_embed\] As with many other things in the web, different browsers have different levels of support for kerning. This makes the feature another prime candidate for Autoprefixer. If you're not inclined to automate, you can do something like this: ```css div#kerningExample { border: 1px solid #cc092f; padding: 1em; width: 100%; text-rendering: optimizeLegibility; -moz-font-feature-settings: "kern"; -moz-font-feature-settings: "kern=1"; -ms-font-feature-settings: "kern"; -o-font-feature-settings: "kern"; -webkit-font-feature-settings: "kern"; font-feature-settings: "kern"; } ``` There are multiple entries for Firefox (indicated as -moz-font-feature-settings) indicating that the format for the feature changed in an incompatible way. The version for Opera (-o-font-feature-settings) is for older versions before adopting Blink. ### Using Lettering.js One of the biggest drawbacks of using CSS Kerning is that it only work with all letters and all words in a document. If you want to work at a finer level you have to work with libraries like [Lettering.js](http://letteringjs.com/). Lettering.js is a jQuery plugin that will automatically add tags (span) and class names to letters, words or lines depending on how we call the plugin. We can then style each individual class as we see fit. You can wrap spans around characters, words, lines and combination of the three to get as tight a control over the text style as you need or want. Because it insert classes, designers must be careful to use it in headings or small chunks of text or it will affect performance. Working with Lettering.js is a three step process. Following the [Lettering.js Wiki Example](https://github.com/davatron5000/Lettering.js/wiki/Wrapping-letters-with-lettering()) we will use this as our example text: ```html