CSS allows to set various properties for text such as characters, spaces, words and paragraph.
The text-indent
property is used to control the indentation of the first line of a block of text.
The possible values are.
Values | Description |
---|---|
<length> | (e.g. 2px, -1in, 1.2cm) |
<percentage> | (e.g. 10%, -20%) |
inherit | The property is inherited from the parent |
The text-align
property is used to to control the alignment of a block of text.
The values of text-align are.
Values | Description |
---|---|
left | right | center | justify | |
<string> | It is used for vertical alignment. Applies for table cells. |
inherit | inherited from parent |
The text-decoration
property is used to control the decoration (underline, line-through, etc) of a block of text.
The values of text-decoration
are.
Values | Desciption |
---|---|
none | underline | overline | line-through | blink | |
inherit | inherited from the parent |
The text-shadow
property is used to attach shadows to a block of text.
The values of text-shadow
are.
Values | Description |
---|---|
none | |
inherit | |
A list of comma-delimated shadow descriptions | |
<color><length_x><length_y><length_r> | <length_x><length_y> - The position of shadow relative to the block. <length_r> - Blur radius. <color> - The color of the shadow. |
<length_x><length_y><length_r><color> |
text-shadow : red 10px 10px; /* Right-bottom*/ text-shadow : 10px 10px 5px yellow; /* left-up, blurred*/ font-shadow : 5px 5px, -5px -5px; /* right-bottom and left-up*/
The letter-spacing
property is used to add extra space between adjacent characters.
The values of letter-spacing
are.
Values | Description |
---|---|
normal | |
<length> | |
inherit | inherited from the parent |
letter-spacing : 0.5em letter-spacing : 5px letter-spacing : 5pt letter-spacing : 0.5cm
The word-spacing
property is used to add extra space between adjacent words.
The values of word-spacing are.
Values | Description |
---|---|
normal | |
<length> | |
inherit | inherited from the parent |
word-spacing : -0.2ex word-spacing : 5cm
The text-transform
property is used to control the capitalization of a block of text..
The values of text-transform
are.
Values | Description |
---|---|
none | |
capitalize | To capitalize the first character of each word. |
uppercase | To capitalize all characters. |
lowercase | To decapitalize all characters. |
inherit | The property is inherited from the parent. |
text-transform : uppercase text-transform : lowercase
The white-space
property is used to control the white spaces inside a block of text.
The values of white-space
are.
Values | Description |
---|---|
normal | |
capitalize | Replaces the sequence of white spaces with a space character. |
pre | White spaces are considered. |
nowrap | Line breaks are not considered. |
inherit | The property is inherited from the parent. |
<style> white-space : nowrap white-space : pre </style>