HTML content is aligned on a page using the CSS text-align property. It sets the horizontal alignment of the content inside a block element or table-cell box. The text-align property works like a vertical-align but in the horizontal direction. It works on text and all other content inside the block element, such as images and buttons.