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 #8AC007;
}
Try it Yourself »
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. Read about animatable Try it |
Version: | CSS2 |
JavaScript syntax: | object.style.bottom="10px" Try it |
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 | Demo ❯ |
length | Sets the bottom edge position in px, cm, etc. Negative values are allowed. Read about length units | Demo ❯ |
% | Sets the bottom edge position in % of containing element. Negative values are allowed | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS tutorial: CSS Positioning
CSS reference: top property
CSS reference: left property
CSS reference: right property
HTML DOM reference: bottom property
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.