Text justification means vertically lining up the first and/or last characters of every line in a paragraph or on a page. To set text justification, use the CSS text-align property with the value justify.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

[About BTH]  [User Agreement]  [Privacy Policy]  [Site Map]  [Contact Form]  [Advertise on BTH]  [News Feed]

Google
Web
This Site

Set Text Justification

Text justification means vertically lining up the first and/or last characters of every line in a paragraph or on a page. Web browers left justify text by default, but they leave ragged edges on the right side of paragraphs.

Right text justification can make your webpage look very neat, but you don't get a free lunch. The browser lines up the ends of sentences by making some lines longer by inserting extra background pixels between some of the words. So, although the right edge of your text may look neatly lined up, the interior of your paragraph will look less neat.

To set text justification, use the CSS text-align property with the value justify. The easiest way to justify all the text on a webpage is to add the style attribute to the <body> tag as shown below.

<body style="text-align:justify;">

To set text justification for all paragraph elements on a webpage, put a style block in the <head> section of your webpage (or in a linked style sheet) with the paragraph selector as shown below.

<style type="text/css">
p
{
text-align:justify;
}
</style>

Text justification looks even neater when you also set margins. To set 20 pixel wide left and right margins with text justification use the code shown below. This code can be used with a fluid layout.

p
{
margin-left:20px;
margin-right:20px;
text-align:justify;
}

The code shown below sets fixed 400 pixel wide paragraphs with text justification.

p
{
width:400px;
text-align:justify;
}

The code shown below sets fixed 400 pixel wide paragraphs with 20 pixel wide left and right margins and text justification.

p
{
margin-left:20px;
margin-right:20px;
width:400px;
text-align:justify;
}

Web browers left justify text by default. Make your webpage look very neat by setting right text justification.

Earn $1 to $5 to complete survey

Web Design Sections
CSS Quick Reference
Use Inline Style
Use an Embedded Style Sheet
Use an External Style Sheet
CSS Units of Measurement
Specifying Color
Set the Text Color
Set the Text Alignment
Set the Letter Spacing
Set the Word Spacing
Set the Line Spacing
Highlight Text
Indent the First Line of Text
Set the Text Decoration
Set Text Justification
Set the Font Family
Set the Font Style
Set the Font Boldness
Set the Font Size
Set the Font Variant
Style the First Letter
Style the First Line
Set the Background Color
Set a Background Image
Set a Background Image's Position
Set a Fixed Background Image
Set the Background Properties
Set the Border Properties
Set the Border Style
Set the Border Width
Set the Border Color
Set an Element's Margin
Set an Element's Padding
Set an Element's Clipping
Set an Element's Overflow
Set an Element's Position
Set an Element's Float
Color the Scrollbar
Set an Element's Overlap
Set an Element's Visibility
Vertical Align an Element
Define CSS Rollover Effects
Web Designer's Reference
[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyright©2001-2007 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269