Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 
Positioning tips.
search engine optimization story search.
Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format


Increase traffic.
Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

HTML Tip:
Be Careful When You Justify

by Larisa Thomason,
Senior Web Analyst,
NetMechanic, Inc.

  
May 2002
(Part 2)
Vol. 5, No. 10
 • Promotion Tip
 • Beginner Tip
 • HTML Tip
  

Web designers who want their page layout to closely resemble print layout often "justify" their text so that each line of text will be equal length. Use justify carefully though, or you could have some unexpected browser display problems.

The problems stem from several sources. You already know this, but we'll say it again: browsers may not display the same page elements consistently. For instance, a common font like Arial may display in a completely different typeface in Netscape than Explorer if you leave out the size attribute.

Similarly, the justified text that looks great in one browser may look quite different when viewed in another.

For instance, compare the word spacing differences between Netscape and Explorer for this justified quotation:

Compare justified text in NS and Explorer

In this example, Netscape's rendering looks better than Explorer's, but the webmaster of DeepSouthSports.com alerted us to a Netscape quirk that could give you fits if you aren't aware of it.

Mystery Words In Netscape

It's the phenomenon of mystery words that repeat onscreen even though the actual HTML code contains the word only once. This problem is relatively rare, but it can be almost impossible to solve. Suppose you have this quote on your Web page:

Quote example with duplicate words

See the extra word? When a short paragraph is justified, Netscape will sometimes repeat the ending word of the first line and make it the first word of the second line.

Frustrated webmasters will immediately note that the quote looks just fine in Explorer and Opera and start combing through their source code, looking for that extra "times." But they won't find it. The only way to solve the problem is to remove the justify attribute.

Know When To Justify

As a general rule, never justify paragraphs that take less than two complete lines to display. Otherwise, you could get really unusual word spacing and/or duplicate words like we showed in our examples.

If you're including the align attribute inside each of your paragraph tags, it's pretty easy to judge when justify isn't needed. Trouble can occur though if you use style sheets to set a style attribute that justifies the text of every paragraph. Cascading style sheets simplify coding because you just declare formatting information once instead of with each individual tag.

If you use style sheets to justify paragraphs, be sure to declare a separate class for short paragraphs. Thus, your style specification might look something like this:

So in your code, the long paragraphs would automatically be justified when you use the paragraph tag, but you'd have to add a class attribute to short ones so they would be left-justified:

<P class="short">

The mystery words and strange line spacing won't show up every time or in every browser. That's why it's critical to test your pages on as many browsers and platforms as you can. But that can be time-consuming - not to mention expensive!

Consider letting Browser Photo do the work for you. It will show you actual screen shots of your Web page in 16 different browser versions and operating system combinations. It's a quick and cost-effective way to test your pages.



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2010,
Keynote NetMechanic
All rights reserved.