How Alignment and Hyphenation Improve your Text’s Impact

Using alignment and hyphenation properly can make your text look better, especially on a small screen. Justified text (when your text goes all the way to the right margin on each line) will result in empty spaces in the middle of lines. Changing to left alignment gets rid of the spaces, but leaves a ragged right margin. Hyphenation can fix that.

Hyphenation isn’t supported in all browsers (not Chrome, Opera or Android), but that’s ok. Hyphenation is an example of progressive enhancement. There’s a nice add-on for the browsers that can do it but users with other browsers won’t be missing out on anything if they don’t get it.

.hyphenate {?
                   -webkit-hyphens: auto;
                   -moz-hyphens: auto;
                   -ms-hyphens: auto;
                   hyphens: auto;
}

In order for hyphenation to work, the browser needs to know? what language the text is in. You can use the lang attribute on ?any element, but generally it’s easiest to put it in the html element if the page is all in one language.

<html lang="en">

If you don’t have a lang attribute, the browser will not hyphenate anything. Keep in mind that each browser can only hyphenate certain languages.

SOURCE: Creative Bloq

Leave comment