CSS right Property


The right property specifies a portion of a positioned element's position. For absolute or fixed positioned elements, the right property is used to set the right margin edge of the element as well as the right edge of its containing block.

Syntax

Example

Preview

Property Values

Value Description
auto Allows the browser to calculate the correct edge position. This is the default setting.
length Sets the right edge position in pixels, centimetres, and so on. Negative values are permitted. Learn more about length units.
% Determines the right edge position as a percentage of the containing element. Negative values are permitted.
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Property Chrome Firefox Safari Edge / IE Opera
right 1.0 1.0 1.0 5.5 5.0