Link to USGS home page
Internal USGS Access Only

Cascading Style Sheets, Text Justification

Centering

To center a paragraph within the current left and right margins use the style rule "text-align" set to "center".

    text-align: center;

this bit of text is centered

Right Alignment

Text can be set flush against the right margin.

    text-align: right;

this text is right aligned

Full Justification

To set the right boundary to be flush rather than ragged. In this example the width is also set to 8 cm to make it easier to see the justification.

    width: 8cm;
    text-align: justify;

The idea there was that consumers would bring their broken electronic devices, such as television sets and VCR's, to the destruction centers, where trained personnel would whack them (the devices) with sledgehammers. With their devices thus permanently destroyed, consumers would then be free to go out and buy new devices, rather than have to fritter away years of their lives trying to have the old ones repaired at so-called "factory service centers," which in fact consist of two men named Lester poking at the insides of broken electronic devices with cheap cigars and going, "Lookit all them WIRES in there!" -- Dave Barry, "'Mister Mediocre' Restaurants"

The same text, unjustified:

The idea there was that consumers would bring their broken electronic devices, such as television sets and VCR's, to the destruction centers, where trained personnel would whack them (the devices) with sledgehammers. With their devices thus permanently destroyed, consumers would then be free to go out and buy new devices, rather than have to fritter away years of their lives trying to have the old ones repaired at so-called "factory service centers," which in fact consist of two men named Lester poking at the insides of broken electronic devices with cheap cigars and going, "Lookit all them WIRES in there!" -- Dave Barry, "'Mister Mediocre' Restaurants"

slide 22


[up]
"Mastering a Web Site" online course
Created and maintained by Lorna Schmid and David Boldt.
http://water.usgs.gov/usgs/training/webmaster/css_text_justification.html    
Last modified: Wed Nov 12 17:24:18 EST 2003