CSS text-align Property


The text-align CSS property sets the horizontal alignment of the inline content like text and images in its parent block element such as heading or paragraph.

CSS Syntax

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

Property Value: The text-align property value are listed below: 
 

  • left: It is used to set the text-alignment into left.
  • right: It is used to set the text-alignment into right.
  • center: It is used to set the text-alignment into center.
  • justify: It is used to stretched the content of an element to display the same width of each line.
  • initial: It is used to set its default value.
  • inherit: It is inherited from its parent.

Example -