CSS text-align-last property

CSS text-align-last

CSS text-align-last is used to specify how the last line in an element should be aligned.

This property sets aligns elements last line. If there are more than one <p> (paragraph) element, the last line of all the paragraph will be aligned.

CSS text-align-last property values are

  • left
  • right
  • center
  • justify
  • auto : It is the default value. The last line is justified and the text is aligned left.
  • start : It aligns the text at the starting of the line.
  • end : It aligns the text at the ending of the line.

left value for css text-align-last property

It is used to align the last line of the paragraph to the left side.

Example

Try Yourself

right value for css text-align-last property

It is used to align the last line of the paragraph to the right side.

Example

Try Yourself

centers value for css text-align-last property

It is used to align the last line of the paragraph to the center position.

Example

Try Yourself

justify value for css text-align-last property

It is used to align the last line of the paragraph by justifying it. The line will start at the left side and end in the right side by adding extra space between words.

Example

Try Yourself