Home

textalign

Text-align is a CSS property that controls the horizontal alignment of inline-level content within a block container. It affects text and inline elements inside the element, not the block box itself. The property is inherited by child elements, allowing consistent alignment within nested content.

Common values include left, right, center, and justify. Directional keywords start and end adapt to the element’s

The alignment of the last line can be customized with the text-align-last property, offering options such as

text-align does not affect the alignment of block-level elements themselves; to align blocks on a page, other

Usage considerations include readability and accessibility. Excessive centering or justification can hinder scanning and comprehension, particularly

writing
mode,
ensuring
correct
alignment
for
both
left-to-right
and
right-to-left
scripts.
The
value
justify
stretches
inter-word
spacing
so
each
line
(except
the
last)
fills
the
line
width.
auto,
left,
right,
center,
justify,
and
more.
In
many
cases,
the
last
line
follows
the
main
text-align
value,
but
text-align-last
allows
finer
control,
especially
for
justified
text.
layout
techniques
such
as
margins,
flexbox,
or
grid
are
used.
It
is
typically
applied
to
block
containers
like
paragraph
and
heading
elements,
influencing
how
their
inline
content
is
arranged.
for
lengthy
passages.
For
multilingual
sites,
using
start
and
end
helps
maintain
proper
behavior
across
different
writing
systems.
In
practice,
text-align
is
widely
supported
across
modern
browsers
and
remains
a
fundamental
tool
for
typographic
alignment
in
web
design.