Text-align

The text-align property of CSS sets the table-cell box’s horizontal alignment or any block element. The text-align property is the same as the CSS property vertical-align but towards any horizontal direction.

Syntax:

text-align: justify | center | right | left | initial | inherit;  

Property Values

justify: Generally, it is used in magazines and newspapers. It can stretch any content of an element to show a similar width of all the lines.

center: Any inline text can be centered using this value.

right: This value aligns the content towards the right side.

left: This value aligns the content towards the left side.

Let’s consider a demonstration of this CSS property.

Example:

Output:

CSS Text-align

Pin It on Pinterest

Share This