HTML DOM Style textAlignLast Property
-- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference Manual
JavaScript Objects
JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error
Browser Objects
Window Object Navigator Object Screen Object History Object Location Object Storage Object
DOM Objects
HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection
HTML Objects
<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>
Style textAlignLast Property
Example
Align the last line of a paragraph to the right:
document.getElementById("myDIV").style.textAlignLast="right";
Definition and Usage
The textAlignLast property specifies how to align the last line of text.
Note: The textAlignLast property only works when the text-align property is set to "justify".
Browser Support
Only Internet Explorer supports the textAlignLast property.
Firefox supports an alternative property, MozTextAlignLast.
Internet Explorer does not support the "start" and "end" values.
Syntax
Get the textAlignLast property:
_object_.style.textAlignLast
Set the textAlignLast property:
_object_.style.textAlignLast="auto|left|right|center|justify|start|end|initial|inherit"
Property Values
| Value | Description |
|---|---|
| auto | Default value. The last line is adjusted and aligned to the left. |
| left | The last line is aligned to the left. |
| right | The last line is aligned to the right. |
| center | The last line is centered. |
| justify | The last line is adjusted to be justified. |
| start | The last line is aligned at the beginning of the line (left-aligned if text-direction is left-to-right; right-aligned if text-direction is right-to-left). |
| end | The last line is aligned at the end of the line (right-aligned if text-direction is left-to-right; left-aligned if text-direction is right-to-left). |
| 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: | A string representing the element's text-align-last property. |
| CSS Version: | CSS3 |
Related Articles
CSS Reference: text-align-last property
YouTip