Easy Tutorial
❮ Met Htmlcollection Nameditem Jsref Repeat ❯

right Property


Definition and Usage

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

This property specifies the right position of the 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

Setting the right property:

Returning the right property:

Value Description
auto Default. The right position is calculated by the browser.
length Defines the right position of the element from the right edge of the nearest positioned parent element using units like px, cm, etc. Negative values are allowed.
% Defines the right position of the element as a percentage from the right edge of the nearest positioned parent element.
inherit The right property value is inherited from the parent element.

Browser Support

All major browsers support the right property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 requires a !DOCTYPE to support "inherit". IE9 supports "inherit".


Example

Setting the right position of a button:

❮ Met Htmlcollection Nameditem Jsref Repeat ❯