CSS text-align-last attribute

CSS Reference CSS Reference


Examples

The last line of the paragraph is aligned to the right:

p
{
text-align: justify;
text-align-last: right;
-moz-text-align-last: right; } /* 针对 Firefox 的代码 */
}


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Internet Explorer supports text-align-last attribute.

Firefox supports another alternative of the property attribute that -moz-text-align-last attribute.

Internet Explorer does not support the "start" and "end" value.


Definition and Usage

text-align-last attribute specifies how to align the text of the last line.

Note: text-align-last attribute works only when the "justify" the text-align property is set.

Defaults: auto
inherit: Yes
Can be animated: no. Please refer to animation (Animatable) .
version: CSS3
JavaScript syntax: object .style.textAlignLast = "right"to try


CSS Syntax

text-align-last: auto|left|right|center|justify|start|end|initial|inherit;

Property Value

描述 测试
auto 默认值。最后一行被调整,并向左对齐。 测试 »
left 最后一行向左对齐。 测试 »
right 最后一行向右对齐。 测试 »
center 最后一行居中对齐。 测试 »
justify 最后一行被调整为两端对齐。 测试 »
start 最后一行在行开头对齐(如果 text-direction 是从左到右,则向左对齐;如果 text-direction 是从右到左,则向右对齐)。 测试 »
end 最后一行在行末尾对齐(如果 text-direction 是从左到右,则向右对齐;如果 text-direction 是从右到左,则向左对齐)。 测试 »
initial 设置该属性为它的默认值。请参阅 initial 测试 »
inherit 从父元素继承该属性。请参阅 inherit

CSS Reference CSS Reference