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>
<html>
<head>
</head>
<body>
<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>
</body>
</html>
Output:
Step:
- See the above, we have created a <p> tag inside the body section.
- 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“.
- See the output, the last line of paragraph text is displayed center others are aligned default position.