您的位置:寻梦网首页编程乐园CSS 初步Cascading Style Sheets Index
Style Sheets
TEXT PROPERTY:
 COLOR
 LETTER-SPACING
 LINE-HEIGHT
 TEXT-ALIGN
 TEXT-DECORATION
 TEXT-INDENT
 TEXT-TRANSFORM
 VERTICAL-ALIGN
 WORD-SPACING


COLOR : COLOR }

Inherited: Yes

The COLOR property allows you to select the color of the text. The default is black.

The COLOR value can be either the keyword color name, the hex six-digit number (#FFFFFF), or the RGB three-digit value (255,255,255). There are sixteen standard colors in HTML:

AQUANAVY
BLACKOLIVE
BLUEPURPLE
FUCHSIA RED
GRAYSILVER
GREENTEAL
LIMEWHITE
MAROONYELLOW

Code:
Selector {COLOR:  RGB(200, 94, 177)}
Selector {COLOR:  #E9ACB2}
Selector {COLOR:  TEAL}


LETTER-SPACING : NORMAL | LENGTH }

Inherited: Yes

The LETTER-SPACING property increases or decreases the spacing (width) of the blank (white) space between adjacent characters or letters. A positive value increases the spacing. A negative value decreases the spacing.

NORMAL

The NORMAL value is the default. With one exception, by declaring NORMAL, you can ensure that any previous declaration will not effect the spacing. Even if NORMAL is declared, the spacing could still be effected by justification by the TEXT-ALIGN property. See the LENGTH value, below, for a way of turning off justification.

LENGTH

The LENGTH value can be negative or positive. A value of zero prevents justification of the text from occurring, even if justification has been declared. The LENGTH can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

Code:
Selector {LETTER-SPACING:  NORMAL}
Selector {LETTER-SPACING:  0}
Selector {LETTER-SPACING:  0.1MM}
Selector {LETTER-SPACING:  -0.2EM}


LINE-HEIGHT : NORMAL | NUMBER | LENGTH | PERCENTAGE }

Inherited: Yes

The LINE-HEIGHT property defines the distance between adjacent lines. This distance is based upon the size of the font.

NORMAL

The NORMAL value is the default. By declaring NORMAL, you can ensure that any previous declaration will not effect LINE-HEIGHT.

NUMBER

The NUMBER value is multiplied times the font size to get the LINE-HEIGHT dimension.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the normal line height being defined as 100%. A PERCENTAGE value below 100% decreases the line height, 100% causes no change, and a value greater than 100% increases the line height.

Code:
Selector {LINE-HEIGHT:  NORMAL}
Selector {LINE-HEIGHT:  1.25}
Selector {LINE-HEIGHT:  1.5IN}
Selector {LINE-HEIGHT:  85%}


TEXT-ALIGN : LEFT | RIGHT | CENTER | JUSTIFY }

Inherited: Yes

The TEXT-ALIGN property aligns a specified selection of text.

LEFT

The LEFT value is the default. The text will be aligned along its left side.

RIGHT

The RIGHT value aligns the text along its right side.

CENTER

The CENTER value aligns each line of the text in the center with an equal amount of blank (white) space on each side of the line.

JUSTIFY

The JUSTIFY value adds blank (white) space between adjacent words and characters in order to align both the right and left sides of a block of text. The LETTER-SPACING property can override justification.

Code:
Selector {TEXT-ALIGN:  LEFT}
Selector {TEXT-ALIGN:  RIGHT}
Selector {TEXT-ALIGN:  CENTER}
Selector {TEXT-ALIGN:  JUSTIFY}


TEXT-DECORATION : NONE |  [ UNDERLINE &| OVERLINE &| LINE-THROUGH &| BLINK ]  }

Inherited: No

The TEXT-DECORATION property allows you to underline, and/or overline, and/or draw a line through a specified selection of text, and/or cause the text to blink.

NONE

The NONE value is the default. By declaring NONE, you can ensure that any previous declaration will not effect the selected text.

UNDERLINE

The UNDERLINE value draws a line under the text. If the text is composed of more than one color, the UNDERLINE will be the color of the first element of the text.

OVERLINE

The OVERLINE value draws a line over the text. If the text is composed of more than one color, the OVERLINE will be the color of the first element of the text.

LINE-THROUGH

The LINE-THROUGH value draws a line through the middle the text. If the text is composed of more than one color, the LINE-THROUGH will be the color of the first element of the text.

BLINK

The BLINK value causes the selected text to flash in and out of view. It is recommended that you use the BLINK value sparingly. Many people dislike blinking text on a web site.

Code:
Selector {TEXT-DECORATION:  NONE}
Selector {TEXT-DECORATION:  UNDERLINE}
Selector {TEXT-DECORATION:  OVERLINE}
Selector {TEXT-DECORATION:  LINE-THROUGH}
Selector {TEXT-DECORATION:  BLINK}
Selector {TEXT-DECORATION:  UNDERLINE  BLINK}
Selector {TEXT-DECORATION:  UNDERLINE  LINE-THROUGH  BLINK}
Selector {TEXT-DECORATION:  UNDERLINE  OVERLINE  LINE-THROUGH  BLINK}


TEXT-INDENT : LENGTH | PERCENTAGE }

Inherited: Yes

The TEXT-INDENT property indents the first line of text to the right or left by the specified LENGTH or PERCENTAGE. If the LENGTH or PERCENTAGE is a negative number, the line is indented to the left. A positive number indents to the right.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total width being defined as 100%.

Code:
Selector {TEXT-INDENT:  25MM}
Selector {TEXT-INDENT:  0.5IN}
Selector {TEXT-INDENT:  -15PC}
Selector {TEXT-INDENT:  24PT}
Selector {TEXT-INDENT:  5.5%}
Selector {TEXT-INDENT:  -8%}


TEXT-TRANSFORM : CAPITALIZE | UPPERCASE | LOWERCASE | NONE }

Inherited: Yes

The TEXT-TRANSFORM property allows you to control capitalization in a selected text.

CAPITALIZE

The CAPITALIZE value will capitalize the first letter in each word in a selected text.

UPPERCASE

The UPPERCASE value capitalizes all letters in a selected text.

LOWERCASE

The LOWERCASE value makes all letters lower case (no capitals) in a selected text.

NONE

The NONE value is the default. By declaring NONE, you can ensure that any previous declaration will not effect a selected text.

Code:
Selector {TEXT-TRANSFORM:  CAPITALIZE}
Selector {TEXT-TRANSFORM:  UPPERCASE}
Selector {TEXT-TRANSFORM:  LOWERCASE}
Selector {TEXT-TRANSFORM:  NONE}


VERTICAL-ALIGN : BASELINE | SUB | SUPER | TOP | TEXT-TOP | MIDDLE | BOTTOM | TEXT-BOTTOM | PERCENTAGE }

Inherited: No

The VERTICAL-ALIGN property allows a wide variety of choices for aligning characters, letters, words, and text with regard to the baseline of a selected line of characters, letters, words, or text.

BASELINE

The BASELINE value is the default. It aligns the selected text to the baseline (bottom) of a line. By declaring BASELINE, you can ensure that any previous declaration will not effect a selected text.

SUB

The SUB value places selected characters, letters, words, or text as a subcript.

SUPER

The SUPER value places selected characters, letters, words, or text as a superscript.

TOP

The TOP value aligns selected characters, letters, words, or text with the tallest character on the same line.

TEXT-TOP

The TEXT-TOP value aligns selected characters, letters, words, or text with the tallest character on a selected line.

MIDDLE

The MIDDLE value aligns selected characters, letters, words, or text with the mid-point (middle) of the same line.

BOTTOM

The BOTTOM value aligns selected characters, letters, words, or text with the lowest character on the same line.

TEXT-BOTTOM

The TEXT-BOTTOM value aligns selected characters, letters, words, or text with the tallest character on a selected line.

PERCENTAGE

The PERCENTAGE value is based upon the line height. The bottom of the line (baseline) is designated 0% and the top is 100%. The PERCENTAGE can be positive or negative and can exceed 100% in magnitude. A negative PERCENTAGE aligns below the baseline.

Code:
Selector {VERTICAL-ALIGN:  BASELINE}
Selector {VERTICAL-ALIGN:  SUB}
Selector {VERTICAL-ALIGN:  SUPER}
Selector {VERTICAL-ALIGN:  TOP}
Selector {VERTICAL-ALIGN:  TEXT-TOP}
Selector {VERTICAL-ALIGN:  MIDDLE}
Selector {VERTICAL-ALIGN:  BOTTOM}
Selector {VERTICAL-ALIGN:  TEXT-BOTTOM}
Selector {VERTICAL-ALIGN:  50%}
Selector {VERTICAL-ALIGN:  -125%}


WORD-SPACING : NORMAL | LENGTH }

Inherited: Yes

The WORD-SPACING property increases or decreases the width of the blank (white) space between adjacent words. A positive value increases the width. A negative value decreases the width.

NORMAL

The NORMAL value is the default. By declaring NORMAL, you can ensure that any previous declaration will not effect the selected text.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

Code:
Selector {WORD-SPACING:  NORMAL}
Selector {WORD-SPACING:  1MM}
Selector {WORD-SPACING:  2.5EM}

Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information