Style bottom property
- Previous Page borderWidth
- Next Page boxShadow
- Go to the Previous Level HTML DOM Style Object
Definition and Usage
bottom
Sets or returns the bottom position of a located element.
Tip:A located element refers to an element with the position property set to: relative, absolute, or fixed.
Tip:To set or return the top position of a located element, use the top property.
See also:
CSS Tutorial:CSS Positioning
CSS Reference Manual:bottom property
Example
Example 1
Set the bottom position of the <button> element:
document.getElementById("myBtn").style.bottom = "100px";
Example 2
Set the bottom position of the <div> element:
document.getElementById("myDiv").style.bottom = "10px";
Example 3
Use negative values - set the bottom position of the <div> element:
document.getElementById("myDiv").style.bottom = "-100px";
Example 4
Returns the bottom position of the <div> element:
alert(document.getElementById("myDiv").style.bottom);
Syntax
Return bottom property:
object.style.bottom
Set bottom property:
object.style.bottom = "auto|length|%|initial|inherit"
Attribute value
Value | Description |
---|---|
auto | Let the browser set the bottom position. Default. |
length | Defines the bottom position with a length unit. Negative values are allowed. |
% | Sets the bottom position with a percentage of the parent element's height. |
initial | Sets this property to its default value. See also initial. |
inherit | Inherits this property from its parent element. See also inherit. |
Technical details
Default value: | auto |
---|---|
Return value: | A string that represents the bottom position of the located element. |
CSS Version: | CSS2 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Previous Page borderWidth
- Next Page boxShadow
- Go to the Previous Level HTML DOM Style Object