CSS vertical-align Property
Complete CSS Reference
Definition
The vertical-align property sets the vertical alignment of an element.
Inherited: No
JavaScript Syntax
CSS properties can also be dynamically changed with a JavaScript.
Scripting Syntax: object.style.verticalAlign="bottom"
In our HTML DOM tutorial you can find more details about the
verticalAlign property.
In our HTML DOM tutorial you can also find a full
Style Object Reference.
Example
|
img
{
vertical-align: bottom
}
|
Possible Values
| Value |
Description |
| baseline |
Default. The element is placed on the baseline of the parent element |
| sub |
Aligns the element as it was subscript |
| super |
Aligns the element as it was superscript |
| top |
The top of the element is aligned with the top of the
tallest element on the line |
| text-top |
The top of the element is aligned with the top of
the parent element's font |
| middle |
The element is placed in the middle of the parent element |
| bottom |
The bottom of the element is aligned with the
lowest element on the line |
| text-bottom |
The bottom of the element is aligned with the
bottom of the parent element's font |
| length |
|
| % |
Aligns the element in a % value of the "line-height"
property. Negative values are allowed |
Try-It-Yourself Demos
Vertical alignment of an image
This example demonstrates how to set the vertical align of an image in a text.
Complete CSS Reference
Learn XML with Stylus Studio XML Tools - Free Download!
 |
|
Stylus Studio makes it easy to edit and validate XML, XSLT, DTD, XML Schema, XHTML, XPath, XQuery and Web Service applications.
Free XML video demonstrations will help you learn XML and become a W3C XML development master in just minutes!
Download a FREE Trial Now!
|
|