試一試
text-align-last: right;
text-align-last: center;
text-align-last: left;
<section id="default-example">
<div>
<p id="example-element">
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.
</p>
</div>
</section>
section {
font-size: 1.5em;
}
#default-example > div {
width: 250px;
}
#example-element {
text-align: justify;
}
語法
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: revert;
text-align-last: revert-layer;
text-align-last: unset;
值
auto-
受影響的行按照
text-align的值對齊,除非text-align為justify,在這種情況下,效果與將text-align-last設定為start相同。 start-
如果方向是從左到右,則與
left相同;如果方向是從右到左,則與right相同。 end-
如果方向是從左到右,則與
right相同;如果方向是從右到左,則與left相同。 left-
行內內容與行框的左邊緣對齊。
right-
行內內容與行框的右邊緣對齊。
center-
行內內容在行框中居中對齊。
justify-
文字兩端對齊。文字的左右邊緣應與段落的左右內容邊緣對齊。
正式定義
正式語法
text-align-last =
auto |
start |
end |
left |
right |
center |
justify |
match-parent
示例
最後一行兩端對齊
CSS
css
p {
font-size: 1.4em;
text-align: justify;
text-align-last: center;
}
結果
規範
| 規範 |
|---|
| CSS Text Module Level 3 # text-align-last-property |
瀏覽器相容性
載入中…