CSS Syntax Manual (ii) Text properties

Source: Internet
Author: User
1, letter-spacing

Function: Controls the spacing between the letters of the text element and sets the distance that applies to the entire element.
Numerical:
Normal-Regular spacing resets the spacing between characters to the normal spacing of all fonts and font sizes.
Length-Sets the length of the word spacing, positive values indicate the normal length of inheritance in the parent element, and negative values subtract the normal length. After the number, specify the unit of measurement as follows: mm, CM, In, pt (Pips), px (pixels), PC (PICA), ex (height of lowercase letter x), EM (width of capital letter m).
Example:


Letter-spacing

2, Line-height

Function: Sets the line spacing of the text in the element.
Numerical:
Normal-regular height, usually 1-1. Twice times the font size, which is the default setting.
Number-Sets the distance for each line of text in the element to multiply the font size by this number. For example, if the font size is 10 points and the Line-height is set to 2, the spacing is 20 points.
Length-Set the spacing in standard units of measure, some are absolute, some are relative, see letter-spacing in the.
Percent-also sets the spacing as a percentage of the font size.


Example: This is the first line.

This is the second line.

This is the third line.

3, Text-align

Function: Aligns the text horizontally in the element box.
Numerical:
Left-Right Align
Right-justified
Center-Center
Justify-evenly distributed, resulting in lines of equal length
Example:


On the left

Center

to the right

4, Text-decoration

Function: Text decoration, used to control the effect of text elements, especially for interesting notes, warnings and other text effects.
Numerical:
None-no text decorations, default settings.
Underline-underline.
Overline-underline.
Line-through-delete line.
Blink-Flashing.
Multiple keywords can be combined in the same statement.
Example:


Underline

Overline

5, Text-indent

Function: Text indent, used to indent the first line of a paragraph.
Numerical:
Length-Sets the size of the first row indent to the specified unit of measure, some units are relative and some are absolute, see the Description section of the Letter-spacing property.
Percent-Sets the first line indent as a percentage of the president.
Example:


Text indentation, which is used to indent the first line of a paragraph.

6, Text-transform

Function: Sets the capitalization criteria for one or several elements.
Numerical:
None-the uppercase lowercase of the text is not changed.
Capitalize-the first letter of each word in the element is capitalized.
Uppercase-Sets all text to uppercase.
Lowercase-Sets all text to lowercase.
Example:


A Text-transform Example.

A Text-transform EXAMPLE.

A text-transform example.

7, Vertical-align

Function: Vertical alignment.
Numerical:
Baseline-aligns the lower-case letter baseline for two elements.
Sub-subscript.
Super-superscript.
Top-aligns the tops.
Text-top-Aligns the top of the text.
Middle-centerline alignment.
Bottom-align the bottom line.
Text-bottom-The letter bottom line is aligned.
Percent-the line element baseline is raised by a percentage of the parent element's baseline, and is used in combination with the element's Line-height attribute.
Example:


a1x2

8, Word-spacing

Function: Controls the spacing between element words in text. The spacing you set applies to the entire element, and you cannot insert a larger or smaller spacing between a word.
Numerical:
Normal-regular spacing.
Length-If the length is positive, then the normal length inherited from the parent element is added, minus if it is a negative value.
Example:


A Word Spacing Example

The above is the CSS Grammar Manual (ii) the content of text attributes, more relevant content please follow topic.alibabacloud.com (www.php.cn)

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.