Web Development HTML Guide - Learn HTML
Developer Tutorials
ASP
CGI & Perl
CSS
Flash
HTML
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML



Developer Manuals
Learn HTML
Learn PHP
Learn MySQL
Learn CSS
Learn Pear


Developer Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Developer Resources
Developer Tools
Developer News
Developer Forums
Developer Content
Developer Book Reviews
Survey Software

Web Hosting Directory
Budget Web Hosting
ColdFusion Hosting
Dedicated Servers
Domain Hosting
E-Commerce Hosting
Email Hosting
Free Web Hosting
Linux Web Hosting
Managed Hosting
Reseller Hosting
Small Business Hosting
Windows Web Hosting

Justification

By default most browsers render text with a jagged right edge. If you want all text rendered like in a book with an even right edge you can use a single style rule. To set all text to justified copy the following code into the section of your document.

If you want all text rendered like in a book with an even right edge you can use a single style rule. To set all text to justified copy the following code into the <HEAD> section of your document.

<STYLE TYPE="text/css">
<!--
BODY
   {
   text-align:justify;
   }
-->
</STYLE>

The problem with justification is that many browsers get confused about where the last line of text is (which shouldn't be justified). For example, MSIE 4.x is confused when a block of text is immediately followed by a table. Notice in this image that the last line of text stretches the words "one of our agents" across a full line:

An example of poor rendering of justification

To remedy this situation surround all blocks of text with <P ...> and </P>:

<P>
The special runs through August 16th, at which time we are required 
by federal law to revert to the old rates. Call one of our agents:
</P>

<TABLE BORDER>
<TR> <TD>Hunter</TD>  <TD>1-2039</TD>
<TR> <TD>Garland</TD> <TD>1-3593</TD>
</TABLE>

Now our errant MSIE renders things more sanely:

Better justification
Copyright Idocs, Inc. Written by Miko Sullivan











About the NetVisits, Inc Network | Advertise
Developer Tutorials hosted by HostGator.
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: