Copyright © tutorialspoint.com
The text-align property determines the way in which line boxes are aligned within a block-level element.
All the block-level elements (except the value <string>, which applies only to table cells)
object.style.textAlign="justify"; |
Following is the example which demonstrates how to align a text:
<p style="text-align:right;"> This will be right aligned. </p> <p style="text-align:center;"> This will be center aligned. </p> <p style="text-align:left;"> This will be left aligned. </p> |
This will produce following result:
This will be right aligned. This will be center aligned. This will be left aligned. |
To Become more comfortable - Do Online Practice
Copyright © tutorialspoint.com