htmlcss

The text-align property is used in CSS and certain HTML elements. It describes how inline content (eg. text) is aligned in its parent block element. This property does not control the alignment of block elements itself, only their inline content.

Values


Mozilla Extensions


To apply this in HTML, use:

<div style="text-align:right;">Text on the right</div>

That will produce:

Text on the right

To apply this in CSS, in the h1 element for example, use:

h1 {
    text-align:center;
}