Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style bottom Property

Style bottom Property

Style Object Reference The Style object


Definition and Usage

The bottom property sets or returns the bottom position of a positioned element.

This property specifies the bottom position of an element, including: padding, scrollbar, border, and margin.

**Tip:** A positioned element is an element whose position property is set to: relative, absolute, or fixed.

Syntax

Set the bottom property:

Object.style.bottom="auto|

length

|

%

|inherit"

Return the bottom property:

Object.style.bottom

Value Description
auto Default. The bottom position is calculated by the browser.
length Sets the position of the element's bottom edge to the bottom edge of the nearest positioned parent element, using units such as px or cm. Negative values are allowed.
% Sets the bottom edge of the element to a percentage position relative to the bottom edge of the nearest positioned parent element.
inherit The value of the bottom property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the bottom property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Set the bottom position of a button:

Runoob Tutorial(runoob.com)

Try it »


Style Object Reference The Style object