CSS参考手册
文本 | Text
文本最终对齐 | text-align-last
该text-align-last
CSS属性描述了一个块或行的最后一行,强制断行前右侧对齐。
/* 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;
Initial value |
auto |
---|---|
Applies to |
block containers |
Inherited |
yes |
Media |
visual |
Computed value |
as specified |
Animation type |
discrete |
Canonical order |
the unique non-ambiguous order defined by the formal grammar |
语法
可能值
auto
——受影响的行按每个text-align
的值对齐(除非text-align
的值是justify
,在这种情况下,效果与设置text-align-last
为start
相同)。
start
——如果方向是从左到右,效果与left
相同,如果方向是从右到左,效果与right
相同。
end
——如果方向是从左到右,效果与right
相同,如果方向是从右到左,效果与left
相同。
left
——内联内容与行框的左边缘对齐。
right
——内联内容与行框的右边缘对齐。
center
——内联内容在行框中居中。
justify
——文字对齐。文本以一定间距排列并保证左右边缘与段落内容的左右边缘对齐。
形式语法
auto | start | end | left | right | center | justify
实例
p {
font-size: 1.4em;
text-align: justify;
-moz-text-align-last: center;
text-align-last: center;
}
规范
Specification |
Status |
Comment |
---|---|---|
CSS Text Module Level 3The definition of 'text-align-last' in that specification. |
Working Draft |
Initial definition |
浏览器兼容性
Feature |
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
---|---|---|---|---|---|---|
Basic Support |
35.0 — 47.01 47.0 |
(Yes) |
12.0 — 53.0 -moz- 49.0 |
No |
(Yes) |
No2 |
Feature |
Android |
Chrome for Android |
Edge mobile |
Firefox for Android |
IE mobile |
Opera Android |
iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support |
No |
35.0 — 47.01 47.0 |
(Yes) |
12.0 — 53.0 -moz- 49.0 |
No |
(Yes) |
No2 |
文本 | Text相关

层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。