HTML CSS examples for CSS Property:text-justify
The text-justify CSS property sets the justification method to use when the text-align property is set to 'justify'.
The following table summarizes the text-justify Property.
Item | Value |
---|---|
Default value: | auto |
Applies to: | Block and optionally inline elements |
Inherited: | Yes |
Animatable: | No. |
The syntax of the property is as follows:
width: auto | none | inter-word | distribute | initial | inherit
The following table describes the values of this property.
Value | Description |
---|---|
auto | The browser determines the justification algorithm to follow. This is default value. |
none | The justification is disabled. |
inter-word | Increases or decreases the spacing between words. |
distribute | Increases or decreases the spacing between letters and words. |
initial | Sets this property to its default value. |
inherit | take the value of its parent element text-justify property. |
The example below shows the text-justify property.
<!DOCTYPE html> <html lang="en"> <head> <title>Example of CSS3 text-justify Property</title> <style type="text/css"> p {<!--from ww w .ja v a 2 s . c om--> width: 400px; text-align: justify; text-justify: inter-word; } </style> </head> <body> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis. In tincidunt orci sit amet elementum vestibulum. Vivamus fermentum in arcu in aliquam. Quisque aliquam porta odio in fringilla. Vivamus nisl leo, blandit at bibendum eu, tristique eget risus. Integer aliquet quam ut elit suscipit, id interdum neque porttitor. Integer faucibus ligula.</p> </body> </html>