<?xml version="1.0" encoding="utf-8"?>

CSS text-align property

CSS text-align property Bad Practice
CSS text-align property Best Practice

For horizontal text alignment, developers use the text-align property. It allows you to apply centered, left, right, or justified alignment (which stretches the lines so that each line has equal width). The respective values are center, left, right, or justify.

Like in the example, centered alignment is a good fit for titles and short copy, while the left alignment is the most popular type for large blocks of text.

Improve your UX & Product skills with interactive courses that actually work