Home > Article > Web Front-end > What are the text css styles?
Text css styles include: text color "color", text direction "direction", character spacing "letter-spacing", text horizontal alignment "text-align", text decoration "text-decoration", header Line indent "text-indent" etc.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Attribute | Description |
---|---|
Set text color | |
Set text direction. | |
Set character spacing | |
Set line height | |
Text horizontal alignment | |
Add decorations to text | |
Indent the first line of text in the element | |
Set the text shadow | |
Control the letters in the element | |
Set or Returns whether the text has been rewritten | |
Text vertical alignment | |
Set the processing method of blanks in elements | |
Set the word spacing |
text-indentFirst line indent
First line indent is to indent the first line of a paragraph, which is commonly used text Formatting effects. Generally, when writing in Chinese, there are two blank spaces at the beginning, similar to this. The value of this attribute is allowed to be negative. Syntax:text-indent:<length> | <percentage> | inherittip: The initial value is 0; Applies to: block-level elements (including block and inline-block)Inheritance : YesPercentage: relative to the width of the containing blockCase: first character sinking
div { width: 200px; border: 1px solid black; text - indent: 0.5em; } div: first - letter { font - size: 30px; float: left; }
text-align horizontal alignment
Horizontal alignment affects the horizontal alignment of text within an element. Syntax:text-align: left | center | right | justify | inheritInitial value: leftApply to: block-level elements (including block and inline-block)Inheritance: YesFor IE7-browser, using text-align will not only change the horizontal alignment of the text, but also change the horizontal alignment of descendant block-level elements
word -spacing word spacing
Word spacing refers to the word spacing, which is used to set the spacing between text or words. In fact, a "word" represents any string of non-whitespace characters surrounded by some kind of whitespace. Note: Words are separated by spaces. The spacing between words = word-spacing space sizeNote: Word spacing can be negative valuesSyntax:word-spacing: <length> | normal | inheritInitial value: normal (default is 0)Applies to: all elementsInheritance: Yes
letter-spacing Letter interval
The letter interval refers to the character interval Note: the letter interval can be a negative valueletter-spacing:<length> | normal | inheritInitial value: normal (default is 0) Applies to: All elementsInheritance: has
text-transformText-transform
Text conversion is used to handle English case conversion. Syntax:text-transform:uppercase(全大写) | lowercase(全小写) | capitalize(首字母大写) | none | inheritInitial value: noneApplies to: all elementsInheritance: yes
text-decorationText decoration
Text decoration is used to provide decorative lines for text. Note: The color of the text modification line is the same as the text color. Syntax:text-decoration:none | [underline(下划线) || overline(上划线) || line-through(中划线)] | inheritInitial value: noneApply to: all elementsInheritance: none(Learning video sharing :
css video tutorial)
The above is the detailed content of What are the text css styles?. For more information, please follow other related articles on the PHP Chinese website!