1. Computing

Discuss in my forum

Lesson 3: CSS Text Properties

CSS Short Courses

By

Updated September 10, 2012

There are many CSS properties that affect text. Here are the CSS properties and how to use them.

word-spacing

The word-spacing property defines the amount of space between words inside the element.

  • word-spacing : normal;
  • word-spacing : +15mm;

Specify the length as you would the height of your font with ems, pixels, picas, points, inches, centimeters, or milimeters.

letter-spacing

Defines the amount of space between each letter.

  • letter-spacing : normal;
  • letter-spacing : +1mm;
  • letter-spacing : -1px;

Specify the length as you would the height of your font with ems, pixels, picas, points, inches, centimeters, or milimeters.

text-decoration

The text-decoration property adds decorations like underlines, overlines, and blink to text.

  • text-decoration : none; (used on A elements to remove the underline.)
  • text-decoration : overline;
  • text-decoration : underline;
  • text-decoration : line-through;
  • text-decoration : blink;

text-transformation

The text-transform property changes the case of the text.

  • text-transform : capitalize;
  • text-transform : uppercase;
  • text-transform : lowercase;
  • text-transform : none; (the default)

text-align

The text-align property defines how the text will be aligned inside the element.

  • text-align : left;
  • text-align : right;
  • text-align : center;
  • text-align : justify;

text-indent

The text-indent defines how much the first line of the text should be indented.

  • text-indent : 15mm;
  • text-indent : 5%;

Specify the length as you would the height of your font with ems, pixels, picas, points, inches, centimeters, or milimeters.

line-height

The line-height property defines the amount of space between lines of text or the leading.

  • line-height : 1.5; (the number of lines)
  • line-height : 5mm;
  • line-height : 10%;

There are many more styles for your text elements, but hopefully, these will get you started using style sheets.

First Page: CSS is Better than the FONT Tag > 1, 2, 3

©2014 About.com. All rights reserved.