mozilla

# Revision 24603 of vertical-align

• Revision slug: CSS/vertical-align
• Revision title: vertical-align
• Revision id: 24603
• Created:
• Creator: DBaron
• Is current revision? No
• Comment /* Values */
Tags:

## Revision Content

{{template.CSSRef()}}

### Summary

The vertical-align property sets the vertical alignment of an inline or table-cell element.

• Inherited: No

### Values (for inline elements)

Most of the values vertically align the element relative to its parent element:

baseline
Align the baseline of the element with the baseline of its parent.
sub
Align the baseline of the element with the subscript-baseline of its parent.
super
Align the baseline of the element with the superscript-baseline of its parent.
text-top
Align the top of the element with the top of the parent element's font.
middle
Align the middle of the element with the middle of lowercase letters in the parent.
text-bottom
Align the bottom of the element with the bottom of the parent element's font.
<length>
Align the baseline of the element at the given length above the baseline of its parent.
<percentage>
like <length> values, with the percentage being a percent of the {{template.Cssxref("line-height")}} property

For elements that do not have a baseline, the bottom margin edge is used instead.

However, two values vertically align the element relative to the entire line rather than relative to its parent:

top
Align the top of the element and its descendants with the top of the entire line.
bottom
Align the bottom of the element and its descendants with the bottom of the entire line.

Negative values are allowed.

### Examples

```img {
vertical-align: bottom;
}
```

## Revision Source

```<p>
{{template.CSSRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>The vertical-align property sets the vertical alignment of an inline or table-cell element.
</p>
<ul><li> Inherited: No
</li></ul>
<h3 name="Values_.28for_inline_elements.29"> Values (for inline elements) </h3>
<p>Most of the values vertically align the element relative to its parent element:
</p>
<dl><dt>baseline </dt><dd>Align the baseline of the element with the baseline of its parent.
</dd><dt>sub </dt><dd>Align the baseline of the element with the subscript-baseline of its parent.
</dd><dt>super </dt><dd>Align the baseline of the element with the superscript-baseline of its parent.
</dd><dt>text-top </dt><dd>Align the top of the element  with the top of the parent element's font.
</dd><dt>middle </dt><dd>Align the middle of the element with the middle of lowercase letters in the parent.
</dd><dt>text-bottom </dt><dd>Align the bottom of the element with the bottom of the parent element's font.
</dd><dt>&lt;length&gt; </dt><dd>Align the baseline of the element at the given length above the baseline of its parent.
</dd><dt>&lt;percentage&gt; </dt><dd>like &lt;length&gt; values, with the percentage being a percent of the {{template.Cssxref("line-height")}} property
</dd></dl>
<p>For elements that do not have a baseline, the bottom margin edge is used instead.
</p><p>However, two values vertically align the element relative to the entire line rather than relative to its parent:
</p>
<dl><dt>top </dt><dd>Align the top of the element and its descendants with the top of the entire line.
</dd><dt>bottom </dt><dd>Align the bottom of the element and its descendants with the bottom of the entire line.
</dd></dl>
<p>Negative values are allowed.
</p>
<h3 name="Examples"> Examples </h3>
<pre>img {
vertical-align: bottom;
}
</pre>
```