September 2, 2000 - Aligning the Last Line | WebReference

September 2, 2000 - Aligning the Last Line

Yehuda Shiran September 2, 2000
Aligning the Last Line
Tips: September 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

There are several ways to align the last line or only line of text in the object. You assign it as follows: = sAlignLast;

where sAlignLast is one of:

auto. The default. Last line aligned like other lines in the object, using the value of textAlign.
  • center. Text is centered.
  • inherit. Text is aligned like in the parent object.
  • justify. Text is right justified.
  • left. Text is left-aligned.
  • right. Text is right-aligned. The following paragraph demonstrates several of the above alternatives for aligning a single line of text (in IE 5.5 and above):

    short line short line

    auto center justify left right Here is how we defined the above paragraph and links:

    <P ID="lastLineEffect" STYLE="text-align:justify; text-align-last:auto">
    short line short line
    <A HREF="javascript:void('auto')">auto</A>
    <A HREF="javascript:void('center')">center</A>
    <A HREF="javascript:void('justify')">justify</A>
    <A HREF="javascript:void('left')">left</A>
    <A HREF="javascript:void('right')">right</A></P>

    Notice that the text-align property must be assigned the value of justify for this example to work.