Style textAlignLast 屬性

Style 對象參考手冊 Style 對象

實例

把段落的最後一行向右對齊:

document.getElementById("myDIV").style.textAlignLast="right";


定義和用法

textAlignLast 屬性規定如何對齊文本的最後一行。

注意:textAlignLast 屬性只有在 text-align 屬性設置為 "justify" 時才起作用。


流覽器支持

Internet Explorer Firefox Opera Google Chrome Safari

只有 Internet Explorer 支持 textAlignLast 屬性。

Firefox 支持另一個可替代該屬性的屬性,即 MozTextAlignLast 屬性。

Internet Explorer 不支持 "start" 和 "end" 值。


語法

返回 textAlignLast 屬性:

object.style.textAlignLast

設置 textAlignLast 屬性:

object.style.textAlignLast="auto|left|right|center|justify|start|end|initial|inherit"

屬性值

描述
auto 默認值。最後一行被調整,並向左對齊。
left 最後一行向左對齊。
right 最後一行向右對齊。
center 最後一行居中對齊。
justify 最後一行被調整為兩端對齊。
start 最後一行在行開頭對齊(如果 text-direction 是從左到右,則向左對齊;如果 text-direction 是從右到左,則向右對齊)。
end 最後一行在行末尾對齊(如果 text-direction 是從左到右,則向右對齊;如果 text-direction 是從右到左,則向左對齊)。
initial 設置該屬性為它的默認值。請參閱 initial
inherit 從父元素繼承該屬性。請參閱 inherit

技術細節

默認值: auto
返回值: 字串,表示元素的 text-align-last 屬性。
CSS 版本 CSS3


相關文章

CSS 參考手冊:text-align-last 屬性


Style 對象參考手冊 Style 對象