Skip to main content

Css Text-align-last Example


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: 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 Status Comment
CSS Text Module Level 3
The definition of 'text-align-last' in that specification.
Candidate Recommendation Initial definition

Browser compatibility








































DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
text-align-last
47
12

49

12-53


5.5

["IE only supports text-align-last when text-align is set to justify.", "The start and end values are not supported."]

34

No

See WebKit bug 76173.

47
47

49

14-53

34

No

See WebKit bug 76173.

5.0

See also




Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools