Forum Moderators: not2easy

Message Too Old, No Replies

Achieving fully justified text

Sometimes it works, sometimes it doesn't

         

GuanoLad

5:11 am on Dec 4, 2003 (gmt 0)

10+ Year Member


Sometimes when I ask for justified text, it will appear as promised. But other times it will be left-aligned.

I haven't fully tested the whys and wherefores, i.e. which way works and which ways don't - has anyone else done this?

This is in IE6.

Example:
Using
<SPAN STYLE="text-align:justify;">
will not work.

But
<TD CLASS="justified">
linking to
TD.justified {text-align:justify;}
will work.

Why?

DrDoc

5:28 am on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The W3C CSS specification says:
This property describes how inline content of a block is aligned.

[w3.org...]

Thus, it will only affect the contents of block level elements.

<SPAN STYLE="text-align:justify;display:block"> will work :)

GuanoLad

5:45 am on Dec 4, 2003 (gmt 0)

10+ Year Member



Well whaddaya know. That even makes sense, too.

Upon appreciating this logic, I tried DIV instead of SPAN, and now it works just fine.

Thanks!