text-align property
Specifies the horizontal alignment of the text within the element.
Aligns text only for block elements. It has the same functionality as the align attribute.
JavaScript page for this property: textAlign. You can find other example(s) there. |
Possible values:
One of the following values:
Text is centered. | |||||||
Text is aligned to the left. | |||||||
Text is aligned to the right. | |||||||
Language dependent align rules. | |||||||
Text is centered. | |||||||
Text is aligned to the left. | |||||||
Text is aligned to the right. | |||||||
The text content of the element is centered. | |||||||
Text is aligned to the end of the element's box. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
The text content of the element is justified. | |||||||
Aligns the text content of the element to the left. | |||||||
Aligns the text content of the element to the right. | |||||||
Text is aligned the start of the element's box. |
Default: left.
Example HTML code 1:
This example illustrates the use of the text-align property:
|
||||
<head> <style> .alignLeft { text-align: left; } .alignCenter { text-align: center; } .alignRight { text-align: right; } </style> </head> <body> <div class="alignLeft"> Align to left </div> <div class="alignCenter"> Align to center </div> <div class="alignRight"> Align to right </div> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
address, blockQuote, body, caption, center, col, colGroup, dd, dir, div, dl, dt, fieldSet, form, H1, H2, H3, H4, H5, H6, html, isIndex, legend, li, listing, marquee, menu, ol, p, plainText, pre, table, td, textArea, th, tr, ul, xmp
Related pages:
color
font
font-family
font-size
font-size-adjust
font-style
font-variant
font-weight
text-align-last
text-autospace
text-decoration
text-indent
text-justify
text-kashida-space
text-overflow
text-shadow
text-transform
text-underline-position
font
font-family
font-size
font-size-adjust
font-style
font-variant
font-weight
text-align-last
text-autospace
text-decoration
text-indent
text-justify
text-kashida-space
text-overflow
text-shadow
text-transform
text-underline-position
External links:
text-align (MSDN)
text-align (Mozilla Developer Center)
text-align (Safari Reference Library)
text-align (W3C)
text-align (Mozilla Developer Center)
text-align (Safari Reference Library)
text-align (W3C)
User Contributed Comments