In CSS "text-align" property specifies how the inline content of a block element is aligned, i.e the horizontal alignment of text in a block element. Always remember that this property applies to block elements.
Generally used values for this property are "left" or "right" or "center". The default value for "text-align" property is "left" and it forces the inline contents to be aligned to the left edge of the line box.
Other than these three values, there are some other values too which can be set for "text-align" property.
One such value is "justify". This value makes the text left and right justified. That is, all lines except (usually) the last one have equal width; the method used to achieve that is typically to leave extra space between words as needed.
One such value is "justify". This value makes the text left and right justified. That is, all lines except (usually) the last one have equal width; the method used to achieve that is typically to leave extra space between words as needed.
The adjoining figure on right hand side shows the same div after the following style was added to it: "text-align:justify;" | The adjoining figure on left hand side shows a div which was rendered in firefox. Since no text-align property was added for this div the default value for text-align was set as "left" by the browser. |
The text-align property is supported in all major browsers.