The best CSS text-align property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Value,More examples,related articles,
h1, h2, and h3 elements set text alignment:
text-align attribute specifies the horizontal alignment of the text element.
Defaults: | left if direction is ltr, and right if direction is rtl |
---|---|
inherit: | yes |
version: | CSS1 |
JavaScript syntax: | object .style.textAlign = "right" |
Figures in the table represent the first browser to support the version number of the property.
Immediately following the digital -webkit-, -ms- or -moz- ago in support of the prefix attribute first browser version number.
属性 | |||||
---|---|---|---|---|---|
text-align | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
value | description |
---|---|
left | The text-align to the left. Default: determined by the browser. |
right | The text-align to the right. |
center | The text-align to the middle. |
justify | Justify the text to achieve the effect. |
inherit | Provisions should inherit values text-align property from the parent element. |
More advanced text alignment example
This example demonstrates a more advanced text alignment example.
CSS tutorial: CSS text