CSS bottom Property
Example
Set the bottom edge of an image to be 5px above the bottom edge of the element:
Property Definition and Usage
For absolutely positioned elements, the bottom property sets the distance higher/lower than the bottom edge of the containing element.
For relatively positioned elements, the bottom property sets the distance higher/lower than the bottom edge of its normal position.
Note: If "position: static", the bottom property has no effect.
Explanation: For static elements, it is auto; for length values, it is the corresponding absolute length; for percentage values, it is 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 value of the other; if neither is auto, bottom takes the opposite value of top.
| Default value: | auto |
|---|---|
| Inherited: | no |
| --- | --- |
| Version: | CSS2 |
| --- | --- |
| JavaScript syntax: | object.style.bottom="50px" |
| --- | --- |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| bottom | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |
Property Values
| Value | Description |
|---|---|
| auto | Default value. The browser calculates the bottom position. |
| % | Sets the bottom position in percent of the containing element. Can use negative values. |
| length | Sets the bottom position using px, cm, etc. Can use negative values. |
| inherit | Specifies that the value of the bottom property should be inherited from the parent element. |
Related Articles
CSS Tutorial: CSS Positioning