• Post category:CSS

CSS Text Align Last Property | Explained

 CSS text-align Last Property

In this article, we will learn how to align the last line of the paragraph. If you want to align the center or left or right to only the last line of the paragraph, we should use the CSS “text align last” property. If you want to align the whole paragraph text then we use the”text-align” property.

How to use align last line of the paragraph

<!DOCTYPE html>
<p style="text-align-last:center ;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>


css text align last property


  1. See the above, we have created a <p> tag inside the body section.
  2. We want to align only the last line of the paragraph text, So, we use the “text-align-last” property and give value as “center“.
  3. See the output, the last line of paragraph text is displayed center others are aligned default position.
READ ALSO  Using CSS Order Property to Change the Order of Items

Leave a Reply