TextAlignLast - Eigenschaft formatieren
Beispiel
Richten Sie die letzte Zeile eines Absatzes rechtsbündig aus:
document.getElementById("myDIV").style.textAlignLast = "right";
Definition und Verwendung
Die Eigenschaft textAlignLast gibt an, wie die letzte Zeile eines Textes ausgerichtet wird.
Hinweis: Die Eigenschaft textAlignLast funktioniert nur für Elemente, bei denen die Eigenschaft text-align auf „justify“ gesetzt ist.
Browser-Unterstützung
Property | |||||
---|---|---|---|---|---|
textAlignLast | Yes | Yes | Not supported Use MozTextAlignLast |
Yes | Yes |
Hinweis: Die Werte „start“ und „end“ werden im Internet Explorer nicht unterstützt.
Syntax
Geben Sie die textAlignLast-Eigenschaft zurück:
object.style.textAlignLast
Legen Sie die textAlignLast-Eigenschaft fest:
object.style.textAlignLast = "auto|left|right|center|justify|start|end|initial|inherit"
Eigenschaftswerte
Value | Description |
---|---|
auto | Default value. The last line is justified and aligned left |
left | The last line is aligned to the left |
right | The last line is aligned to the right |
center | The last line is center-aligned |
justify | The last line is justified as the rest of the lines |
start | The last line is aligned at the beginning of the line (left if the text-direction is left-to-right, and right is the text-direction is right-to-left) |
end | The last line is aligned at the end of the line (right if the text-direction is left-to-right, and left is the text-direction is right-to-left) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technische Details
Standardwert: | Auto |
---|---|
Rückgabewert: | Ein String, der die text-align-last-Eigenschaft eines Elements darstellt |
CSS-Version | CSS3 |
Verwandte Seiten
CSS-Referenz: text-align-last-Eigenschaft
❮ Style-Objekt