views:

6016

answers:

12

Is there any reason to avoid using "text-align: justify;"?

Does it reduce readability or cause problems?

A: 

I prefer left justification (text-align: left) because it's generally more readable. It's also quicker to read evenly-spaced words, so I hear. Unless you have a stylistic reason for using justify, keep it left, right, or center. Especially for body text, use left. (Actually, you'd want something like "forward" for text in the other direction (e.g. Hebrew)...)

strager
+3  A: 

There's no technical reason not to - it's purely a design decision. Many people find that justified text is harder to read, but I guess it depends on your situation. Though it works fine for print, generally web browsers do not give enough control over the eventual output of text to guarantee that what you're serving won't look like crap on some people's screens.

Your best option is to avoid justification.

nickf
A: 

I think it is perfectly OK on print, but it is clunky on most Web browsers, by lack of fine control of spacing and hyphenation. Typographers can even play slightly on letter spacing or font contraction in some cases, as pages/columns (at least in magazines) can be finely tuned.

PhiLho
+7  A: 

text-align: justify shouldn't be used in browsers at the moment. They aren't good at handling the minute details within and the output ends up containing lots of rivers and there's no support for hyphenation (other than soft hyphens).

Edit: Hyphenator was brought to my attention in this answer's comments. It looks like it makes text-align justify worth using, check out the sites that use it. You may want to use javascript to apply text-align justify before using this script so that those without javascript don't get caught out.

dylanfm
Have you heard of hyphenator [ http://code.google.com/p/hyphenator ]? Maybe you should edit your answer to mention it, if you think it's worth mentioning.
ShreevatsaR
+6  A: 

The problems brought up by others about justify alignment are more prevalent with narrow columns. If your columns are wide enough in relation to the size of your fonts and other parameters then it's ok to justify the text. Let's say you'd want a minimum of 12 to 15 words per line in average. More is better.

allesklar
Voted up. However the prevailing recommendation seems to be about 10 words per line for maximum legibility/readibility.
Andy Ford
If you want to get more precise it's ~65 characters per line.
dylanfm
thanks, dylanfm. That is a more reliable measure due to its precision =)
Andy Ford
It's 10 words for readability in general but in my experience that's a bit light for justified text.
allesklar
No worries Andy :) hehe
dylanfm
+1  A: 

Like any web design question... it depends. As has been suggested, justified text does not usually end up looking good in narrow columns. I'd recommend against it as a general rule in sidebars as sidebars are usually narrow.

With body copy at the often recommended 10 words per line (or with any amount above that) you will probably be able to get away with justified text and have it look reasonably good most of the time unless you're using a lot of really long words and/or strings.

I think I've pimped this site on StackOverflow before, but Jon Tan uses justified text in his body copy (within articles) and it looks great 99.99% of the time.

Andy Ford
A: 

Erhh... No...!

[seriously] WordPress uses justify, and I think that's a pretty strong statement in regards to whether or not it decreases readability...

Thomas Hansen
A: 

I cant think of a compelling reason why not to justify text - at a certain point the volume and width of content almost demand that it be justified. Of course, you'll get issues with content consisting of certain word combinations, but to my mind if you're seeing rivers and unusually large spaces between words you have a different problem altogether - one of readability and clarity.

What I would avoid, at all costs, is centered body text. I don't think there's a greater red flag of ammateurish web design than that.

infoxicated
+3  A: 
hlfcoding
A: 

I'm using "justify" on my blog because I think it looks more formal. But the problem is, whenever I'm viewing it in "Feedly", I cannot see the paragraphs. Maybe I should try to use "align-left" now. I don't know if it's related but I'm really confuse now.

Christian
A: 

Justification should not be used without hyphenation. Here is a PHP based hyphenation library, and a port of this library to a WordPress plugin: wp-Typography.

kingjeffrey
A: 

agree it's a bit clunky on screen but works well on print, really down to the project at hand.

a lot of architectural firm's prefer text fitting closely within a grid layout without the drop-off on the side and text-align:justify helps this a lot.

really a design decision.

John Antoni Griffiths