text-indent
text-align
text-decoration
text-shadow
letter-spacing
word-spacing
text-transform
white-space
affects the visual presentation of characters, spaces, words, and paragraphs.
text-indent
Initial:0 ; Applies to: block-level elements ; Percentages:refer to width of containing block
Specifies the indentation of the first line of text in a block. of the first box that flows into the block's first line box. The box is indented with respect to the left (or right, for right-to-left layout) edge of the line box. Rendered as blank space.
text-indent
may be negative, but there
may be implementation-specific limits.
This example should cause a '10em' text indent.
P { text-indent: 10em ;font-family:monospace}
<div style=text-indent:10em;font-family:monospace> This applies only at the beginning of the paragraph!! When text wrapping occurs the second line in the paragraph is not indented. <p style=text-indent:-10em;font-family:monospace> This applies only at the beginning of the paragraph!! When text wrapping occurs the second line in the paragraph is not indented. </p> occures here <p> <p> some more after the </p> starts to indent at the <div> setting
<div>
|
012345678 012345678 012345678
This applies only at the beginning of the paragraph!! When
text wrapping occurs the second line in the paragraph is not indented.
This applies only at the beginning of the paragraph!! When
text wrapping occurs the second line in the paragraph is not indented.
some more after the |
text-align:
left
| right
| center
| justify
| <string> | inherit Describes how inline content of a block is aligned.
left
or right
,
depending on whether direction
is ltr
, or rtl
,
. A block of text is a stack of line boxes.
In the case of left
, right
and center
, this specifies
how the inline boxes within each line box align with respect to the line box's
left and right sides; alignment is not with respect to the viewport.
In the case of justify
the UA may stretch the inline boxes in addition to
adjusting their positions. (See letter-spacing
and word-spacing
.)
Example(s):
In this example, since text-align
is inherited, all block-level
elements inside the DIV element with class=center
will have their inline
content centered.
DIV.center { text-align: center }
The actual justification algorithm used is user-agent and written language dependent.
Conforming user agents may interpret the value justify as
left or right depending on whether the element's default writing direction
is left-to-right
or right-to-left
.
text-decoration
:none | [ underline || overline || line-through || blink ] |
inherit
IMG
), user agents must ignore
this property.
blink
alternates between visible
and invisible
Conforming
user agents are not required to support this value.
Colors should be derived from the color
property value.
Not inherited, descendant boxes of a block box should be
formatted with the same decoration (e.g., they should all be underlined).
The color of decorations should remain the same even if descendant elements have
different color
values.
Example(s):
In the following example for HTML, the text content of all A elements acting as hyperlinks will be underlined:
A[href] { text-decoration: underline }
text-shadow
:none | [
<color> ||
right
below
radius? ,]*
lt;color> ||
right<length>
below<length>
radius<length>?] |
inherit
Applies to:all elements ; not Inherited
Comma-separated list of shadow effects to be applied
to the text of the element, in the order
specified and may overlay, but will never overlay the text .
Shadow effects do not alter the size of a box, but may extend beyond its boundaries.
The stack
level of the shadow effects is the same as for the element .
Each shadow effect must specify shadow offsets and may specify a blur radius and a shadow color.
A shadow offset is specified with two <length> signed values
that indicate the distance from the text.
The first length value specifies the horizontal distance to the right of the text,
negative values to the left of the text.
The second length value specifies the
vertical distance below the text, negative value above the text.
An optional blur radius indicates the boundaries of the blur effect. The
exact algorithm for computing the blur effect is not specified.
If no color is specified, the value of the color
property will be used instead.
Text shadows may be used with the :first-letter and :first-line pseudo-elements.
A text shadow to the right and below the element's text, no color has been specified, the shadow will have the same color as the element , and no blur radius is specified, the text shadow will not be blurred:
<span style=font-size:300%;text-shadow:5px 5px ;color:navy>shadowed<span>shadowed
letter-spacing
normal
Specifies spacing behavior between text characters.
Character spacing algorithms are user agent-dependent. Character spacing may
also be influenced by justification (see text-align
).
In this example, the space between characters in BLOCKQUOTE elements is increased by '0.1em'.
BLOCKQUOTE { letter-spacing: 0.1em }
In the following example, the user agent is not permitted to alter inter-character space:
BLOCKQUOTE { letter-spacing: 0cm } /* Same as '0' */
When the resultant space between two characters is not the same as the default space, user agents should not use ligatures.
Conforming user agents may consider the value of the letter-spacing
property to be
normal
word-spacing
Value: | normal | <length> | inherit |
Initial: | normal |
Applies to: | all elements |
Inherited: | yes |
Percentages: | N/A |
Media: | visual |
This property specifies spacing behavior between words. Values have the following meanings:
Word spacing algorithms are user agent-dependent. Word spacing is also
influenced by justification (see the text-align
property).
Example(s):
In this example, the word-spacing between each word in H1 elements is increased by '1em'.
H1 { word-spacing: 1em }
Conforming user agents may consider the value of the This property controls capitalization effects of an element's text. Values
have the following meanings: The actual transformation in each case is written language dependent. See RFC
2070 ([RFC2070]) for ways to find the
language of an element.
Conforming user agents may consider the value of In this example, all text in an H1 element is transformed to uppercase text. This property declares how whitespace
inside the element is handled. Values have the following meanings: Example(s): The following examples show what whitespace
behavior is expected from the PRE and P elements, and the "nowrap" attribute in
HTML. Conforming user agents may ignore the word-spacing
property to be 16.5 Capitalization: the
text-transform
property
text-transform
Value:
capitalize | uppercase | lowercase | none | inherit
Initial:
none
Applies to:
all elements
Inherited:
yes
Percentages:
N/A
Media:
visual
text-transform
to be H1 { text-transform: uppercase }
16.6 Whitespace: the
white-space
property
white-space
Value:
normal | pre | nowrap | inherit
Initial:
normal
Applies to:
block-level elements
Inherited:
yes
Percentages:
N/A
Media:
visual
PRE { white-space: pre }
P { white-space: normal }
TD[nowrap] { white-space: nowrap }
white-space
property in author and user
style sheets but must specify a value for it in the default style sheet.