CSS bottom property
Example
Set the bottom edge of the image 5px above the bottom edge of the element:
img
{
position:absolute;
bottom:5px;
}
Try it »
Property definition and usage
For absolutely positioned elements, the bottom property sets the position above/below the bottom edge of the containing element.
For relatively positioned elements, the bottom property sets the position above/below the element's normal bottom edge.
**Note:** If "position:static", the bottom property has no effect.
Explanation: For static elements, it is auto; for length values, the corresponding absolute length; for percentage values, the specified value; otherwise it is auto. For relatively positioned elements, if both bottom and top are auto, their computed values are both 0; if one of them is auto, it takes the opposite of the other value; if neither is auto, bottom takes the opposite of the top value.
| Default value: | auto |
|---|---|
| Inheritance: | no |
| Version: | CSS2 |
| JavaScript syntax: | object.style.bottom="50px" |
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| bottom | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |
Attribute values
| Value | Description |
|---|---|
| auto | Default. The bottom position is calculated by the browser. |
| % | Sets the bottom position as a percentage of the containing element. Negative values are allowed. |
| length | Sets the bottom position of the element using units such as px, cm, etc. Negative values are allowed. |
| inherit | Specifies that the bottom property should be inherited from the parent element. |
Related Articles
CSS Tutorial: CSS Positioning