O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

right

Values:

<length> | <percentage> | auto

Initial value:

auto

Applies to:

Positioned elements (that is, elements for which the value of position is something other than static)

Inherited:

No

Percentages:

Refer to the width of the containing block

Computed value:

For relatively positioned elements, see the note; for static elements, auto; for length values, the corresponding absolute length; for percentage values, the declared value; otherwise, auto.

Description:

Defines the offset between the right outer margin edge of a positioned element and the right edge of its containing block.

Examples:

div#footer {position: fixed; right: 0;}
*.overlapper {position: relative; right: −25px;}

Note:

For relatively positioned elements, the computed value of left always equals right.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required