Text Properties






PropertyDescriptionPossible ValuesExamples
colorDeclares the color of the text.Valid color names, RGB values, hexidecimal notation.

The predefined color names are:

aqua
black
blue
fuchsia
gray
green
lime
maroon
navy
olive
purple
red
silver
teal
white
yellow

div { color:green; }

div {color:rgb(0,255,0);}

div { color:#00FF00; }

directionDeclares the reading direction of the text.
ltr
rtl

ltr = left-to-right
rtl = right-to-left

div { direction:ltr; }

div { direction:rtl; }

line-heightDeclares the distance between lines.Numbers, percentages, lengths, and the predefined value of normal.
div { line-height:normal; }

div { line-height:2em; }

div { line-height:125%; }

letter-spacingDeclares the amount of space between text characters.A length (in addition to the default space) or the predefined value of normal.
div { letter-spacing:normal; }

div { letter-spacing:5px; }

div { letter-spacing:-1px; }

text-alignDeclares the horizontal alignment of inline content.
left
right
center
justify

If used on a set of table cells, this property can be given a string value to which the text of each row of the column will be aligned.

div { text-align:center; }

div { text-align:right; }

td { text-align:"."; }

text-decorationDeclares the text decoration.
none
underline
overline
line-through
blink
div { text-decoration:none; }

div { text-decoration:underline; }

text-indentDeclares the indentation of the first line of text.Lengths and percentages.
div { text-indent:12px; }

div { text-indent:2%; }

text-shadowDeclares shadow effects on the text.A list containg a color followed by numeric values (separated by spaces) that specify:
  1. The color for the shadow effect
  2. Horizontal distance to the right of the text
  3. Vertical distance below the text
  4. Blur radius
div { text-shadow:green 2px 2px 7px; }

div { text-shadow:olive -3px -4px 5px; }

text-transformDeclares the capitalization effects on the letters in the text.
none
capitalize
uppercase
lowercase
div { text-transform:uppercase; }

div { text-transform:lowercase; }

unicode-bidiDeclares values relating to bidirectional text. May be used in conjunction with the thedirection property.
normal
embed
bidi-override
div { unicode-bidi:embed; }

div { unicode-bidi:bidi-override; }

white-spaceDeclares how white space is handled in an element.
normal
pre
nowrap
div { white-space:pre; }

div { white-space:nowrap; }

word-spacingDeclares the space between words in the text.A length (in addition to the default space) or the predefined value of normal.
div { word-spacing:normal; }

div { word-spacing:1.5em; }



Back to Learn More About CSS