CSS bottom Property
Example
Set the bottom edge of the <div> element to 10px above the bottom edge of its nearest parent element with some positioning:
div.absolute {
position: absolute;
bottom: 10px;
width: 50%;
border: 3px solid #0054ff;
}
position: absolute;
bottom: 10px;
width: 50%;
border: 3px solid #0054ff;
}
Definition and Usage
The bottom
property affects the vertical position of a positioned element. This property has no effect on non-positioned elements.
- If position: absolute; or position: fixed; - the
bottom
property sets the bottom edge of an element to a unit above/below the bottom edge of its nearest positioned ancestor. - If position: relative; - the
bottom
property makes the element's bottom edge to move above/below its normal position. - If position: sticky; - the
bottom
property behaves like its position is relative when the element is inside the viewport, and like its position is fixed when it is outside. - If position: static; - the
bottom
property has no effect.
Default value: | auto |
---|---|
Inherited: | no |
Animatable: | yes. |
Version: | CSS2 |
JavaScript syntax: | object.style.bottom="10px" |
- Inherited : "Inherited = no" means that it cannot takes (inherit) it's value from it's parent element.
- object - object in javascript means the element on which
bottom
is applied. - Animatable - "Animatable = yes" means that it can be animated with CSS
@keyframes
.
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 |
CSS Syntax
bottom: auto|length|initial|inherit;
Property Values
Value | Description | Demo |
---|---|---|
auto | Lets the browser calculate the bottom edge position. This is default | |
length | Sets the bottom edge position in px, cm, etc. Negative values are allowed. | |
% | Sets the bottom edge position in % of containing element. Negative values are allowed | |
initial | Sets this property to its default value. | |
inherit | Inherits this property from its parent element. |
Comments
Post a Comment