= Typographic alignment
{wiki}
\b[Typographic alignment] places a line's content relative to its available horizontal space. Common choices align its left edge, align its right edge, centre it or apply <text justification>. In <CSS>, `text-align` specifies alignment within the line's container, rather than positioning the entire container in the page.<Text in Cascading Style Sheets Level 2 Revision 2 by World Wide Web Consortium>[§16.2: alignment within line boxes and text-align values]{ref}
For a rigid line with <natural line width> $N\leq W$, no indentation, and a left boundary at $x=0$, the starting positions are
$$
\boxed{x_{\rm left}=0,\qquad x_{\rm centre}=\frac{W-N}{2},\qquad x_{\rm right}=W-N.}
$$
Thus $N=24$ and $W=40$ give starts 0, 8 and 16. These three choices preserve the internal <word spacing>. <Text justification> can instead change that spacing through <typesetting glue> so the content reaches the intended edges. The alignments therefore solve different geometric tasks even when the same words and <computer font> are used.
Back to article page