CSS Text Properties

Source: Internet
Author: User
Tags define inheritance lowercase reference
CSS Letter-spacing
Property value: Normal | <length>
Initial value: Normal
Apply to: all elements
Inheritance: Yes
Percent value: not applicable
The "Letter-spacing" property defines the extra spacing between each character, which must be in length and the positive and negative values are allowed.
For example, the following example:
<HTML>
<title>css demo</title>
<style type= "Text/css" >
<!--
H1{LETTER-SPACING:1EM}
P{LETTER-SPACING:-.1EM}
-->
</style>
<body>
<p>this is text with negtive letter-spacing.</p>
</body>
</HTML>

Text-decoration
Property value: None | [Underline | | overline | | line-through | | blink]
Initial value: None
Apply to: all elements
Inheritance: No
Percent value: not applicable
This property enables you to define the "decorative" style of the text in an element, which has a total of five forms.
None None
Underline underline
Overline underline
Line-through Delete Line
Blink flashing

Vertical-align
Attribute Value: Baseline | Sub | Super | Top | Text-top | Middle | Bottom | Text-bottom | <percentage>
Initial value: Baseline
Applies to: inline elements
Inheritance: No
Percent value: reference element self Line-height value
The "Vertical-align" property defines the position of an element in the vertical direction, which is relative to the position of its parent element. The property value of "Vertical-align" can be either a keyword or a percent value.


Keyword description
Baseline aligns the baseline of an element with the baseline of the ancestor element, and if the element has no baseline, the bottom of it is aligned with the baseline of the ancestor element.
Middle aligns the vertical midpoint of an element with the vertical midpoint of the ancestor element.
Sub element subscript
Super element superscript
Text-top aligns the top of the element with the top of the upper element text.
Text-bottom aligns the bottom of the element with the bottom of the ancestor element text.
Top aligns the tip of the element with the highest element of the line.
Bottom aligns the bottom of the element with the lowest element of the line.


Text-transform
Attribute value: Capitalize | Uppercase | lowercase | None
Initial value: Nono
Apply to: all elements
Inheritance: Yes
Percent value: not applicable
The "Text-transform" property converts text to four different forms:

Capitalize the first letter of each word in the capitalize text
Capitalize all words in uppercase text
All characters in lowercase text are lowercase
None using default values

Text-align
Property value: Left | Right | Center | Justify
Initial value: set by UA default value
Apply to: block-level elements
Inheritance: Yes
Percent value: not applicable
This element determines the alignment of the text in the element, and it applies to all block elements, and it works somewhat like the "ALIGN" attribute in the HTML language.

Left-aligned
Right aligned
Center text centered
Justify Justify

Text-indent
Attribute Value:<length> | <percentage>
Initial value: 0
Apply to: block-level elements
Inheritance: Yes
Percent value: Refer to the width of the parent element
The "Text-indent" property is applied to block-level elements, which define how the first line of text is indented.

p{text-indent:1cm}
This indentation is called "First line Indent", some of the first line of each paragraph must be indented two-word position, while the other rows of the left start position unchanged.

Line-height
Property value: Normal | <number> | <length> | <percentage>
Initial value: Normal
Apply to: all elements
Inheritance: Yes
Percent value: The font size of the reference element itself
This property is used to define the height of the text line when you speak the Font property earlier. The so-called row height, which is the distance between two adjacent lines of text baselines, can be defined with numeric, length, or percent values, but not negative numbers.
When you use a number as a property value, the row is equal to the number of font numbers you specify multiplied by that number.
When using the length value as the property value, the row height is exactly equal to the given value.
When you use a percent value as a property, the row is equal to the font size multiplied by the percentage value.

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.