Styling Type and Using Webfonts In Your Pages

Most designers have an appreciation for well-designed typfaces and want to utilize them a design element in their work. Thanks to CSS and webfonts, we have many options now when it comes to bringing type into web pages.

This page is intended for use in practicing applying CSS to style type. A basic stylesheet has been set up and organized as a starting point and the content of this page contains some notes about various typographic CSS properties.

Have fun with this and use it to help become familiar with type-related CSS.

CSS Type Styling Properties

There are several CSS properties relating to typographic styles that most designers are familiar with from working in page layout and design software.

Here are the properties we can use:

Basic Type Formatting

Typographic Alignment and Spacing

Text Align

The text-align property is used to control how text is aligned within its containing content box. The available values are as follows, and work in pretty much the same way as they do in a regular word processor application:

Line Height

The line-height property sets the height of each line of text — this can take most length and size units, but can also take a unitless value, which acts as a multiplier and is generally considered the best option — the font-size is multiplied to get the line-height. Body text generally looks nicer and is easier to read when the lines are spaced apart; the recommended line height is around 1.5 – 2 (double spaced.)

Letter and Word Spacing

The letter-spacing and word-spacing properties allow you to set the spacing between letters and words in your text. You won't use these very often, but might find a use for them to get a certain look, or to improve the legibility of a particularly dense font. They can take most length and size units.