文本最终对齐 | text-align-last
该text-align-lastCSS属性描述了一个块或行的最后一行,强制断行前右侧对齐。
/* 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 |
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

