Text Properties |
|||
Comments: These properties let you control basic text formatting. Some may also be applied to non-text elements. | |||
Property | Description | Values | Example |
text-transform | Set the case of the text. | capitalize uppercase lowercase none |
p {text-transform: capitalize} Capitalizes the first character of each word in the paragraph. H2 {text-transform: uppercase} Displays all level two headlines in all uppercase characters. |
vertical-align | Aligns the element vertically to the baseline. Can be very useful with images. | baseline sub super top text-top middle bottom text-bottom |
img {vertical-align: middle} Places the image in the middle of the baseline. |
text-align | Aligns the element horizontally across the page or within division | left right center justify |
H3 {text-align: center} Centers all level three headlines. |
text-indent | Sets the amount of indent for the first line of a text block | XX units % |
p {text-indent: 2em} Indents the first line of the paragraph 2 em spaces. |
line-height | Also known as "leading" or "line space." Specifies the distance between baselines of consecutive lines of text. | normal XX units % |
p {line-height: 12pt} Sets 12 points of space from baseline to baseline in paragraph. |
letter-spacing
|
Lets you control the space between letters. | normal XX units |
p {letter-spacing: 0} Prevents any extra space from being added between letters in a paragraph. |
text-decoration | Sets underlining, overlining, strike-through, or blink attributes for the element. Vendors may be adding their own text decoration formats, as well. | underline line-through none |
H1 {text-decoration: underline} Underlines all level one headlines. |