This site is designed for accessibility. Content is obtainable and functional to any browser or Internet device. This site's full visual experience is available in a graphical browser that supports web standards. Please consider upgrading your web browser.

Alignment

Vertical Alignment

The vertical alignment property affects the vertical positioning inside a line box of the boxes generated by an inline-level element. It applies only to inline elements, although that includes replaced elements such as images and form inputs. It is not inherited. Element content is typically vertically centered on a rendered line (with extra line-height amounts distributed equally on the top and bottom.) This property allows inline content boxes to be vertically aligned with respect to several different criteria on a rendered line.

Values include:

The remaining values refer to the line box in which the generated box appears:

In CSS1 vertical-align only took percentage and some named values but CSS2:10.8.1 expands the range of premitted values a bit. See the definition of line-height for details.

Horizontal Alignment

Compared to vertical alignment, horizontal alignment with the property text-align is simple. There are only four values:

The default value is dependent on the language being used in the document, but will usually be either left or right.