text-align-last
Quick Summary for text-align-last
The text-align-last CSS property sets how the last line of a block or a line, right before a forced line break, is aligned.
Code Usage for text-align-last
/* Keyword values */ text-align-last: auto; text-align-last: start; text-align-last: end; text-align-last: left; text-align-last: right; text-align-last: center; text-align-last: justify;  /* Global values */ text-align-last: inherit; text-align-last: initial; text-align-last: revert; text-align-last: unset; 
More Details for text-align-last

text-align-last

The text-align-last CSS property sets how the last line of a block or a line, right before a forced line break, is aligned.

Syntax

/* Keyword values */ text-align-last: auto; text-align-last: start; text-align-last: end; text-align-last: left; text-align-last: right; text-align-last: center; text-align-last: justify;  /* Global values */ text-align-last: inherit; text-align-last: initial; text-align-last: revert; text-align-last: unset; 

Values

auto

The affected line is aligned per the value of text-align, unless text-align is justify, in which case the effect is the same as setting text-align-last to start.

start

The same as left if direction is left-to-right and right if direction is right-to-left.

end

The same as right if direction is left-to-right and left if direction is right-to-left.

left

The inline contents are aligned to the left edge of the line box.

right

The inline contents are aligned to the right edge of the line box.

center

The inline contents are centered within the line box.

justify

The text is justified. Text should line up their left and right edges to the left and right content edges of the paragraph.

Formal definition

Initial valueauto
Applies toblock containers
Inheritedyes
Computed valueas specified
Animation typediscrete

Formal syntax

auto | start | end | left | right | center | justify

Examples

Justifying the last line

CSS
p {   font-size: 1.4em;   text-align: justify;   text-align-last: center; } 
Results

Specifications

Specification
CSS Text Module Level 3 # text-align-last-property

See also

text-align

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)DeutschFrançais日本語Русский中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
When I realized that, no individual step is hard in any process. Building this airport I'm standing in right now started with a guy writing the architectural plans on paper. That's not hard for him to do. Then laying the first beam isn't had. The whole thing is really hard. So, just take each step kind of piece by piece and when I was able to do that and stop trying to chase this prize and started putting in the work, things just started coming together.
Unknown
Random CSS Property

<resolution>

The <resolution> CSS data type, used for describing resolutions in media queries, denotes the pixel density of an output device, i.e., its resolution.
resolution#dppx css reference