Style textAlignLast property
- Forrige side textAlign
- Næste side textDecoration
- Gå tilbage til forrige niveau HTML DOM Style Object
Definition and Usage
textAlignLast
This property specifies how to align the last line of text.
Note:textAlignLast
This property applies only to the text-align property set to "justify"
element.
See also:
CSS Reference Manual:text-align-last property
Example
Align the last line of the paragraph to the right:
document.getElementById("myDIV").style.textAlignLast = "right";
Syntax
Return textAlignLast property:
object.style.textAlignLast
Set textAlignLast property:
object.style.textAlignLast = "auto|left|right|center|justify|start|end|initial|inherit"
Property value
Value | Description |
---|---|
auto |
Default value. The alignment rule for each line is determined by the value of text-align. When the value of text-align is justify, the behavior of text-align-last is the same as setting start. |
left | Aligns the last line of text to the left. |
right | Aligns the last line of text to the right. |
center | Centers the last line of text. |
justify | Aligns the last line of text with the rest of the lines (both ends). |
start | Aligns the last line of text at the beginning of the line (if the text direction is from left to right, it is left-aligned, and if the text direction is from right to left, it is right-aligned). |
end | Aligns the last line of text at the end of the line (if the text direction is from left to right, it is right-aligned, and if the text direction is from right to left, it is left-aligned). |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | auto |
---|---|
Return value: | string indicating the text-align-last property. |
CSS version: | CSS3 |
browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Ikke understøttet Brug venligst MozTextAlignLast |
Support | Support |
- Forrige side textAlign
- Næste side textDecoration
- Gå tilbage til forrige niveau HTML DOM Style Object