The right property specifies the distance from the element's right outer margin to the right edge of the content block.

  • Initial valueauto
  • Applies toPositioned elements
  • InheritedNo
  • MediaVisual
  • Computed valueIf specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, 'auto'.
  • AnimatableYes
  • CSS VersionCSS2, CSS3
  • JavaScript
Formal syntax: auto | <length> | <percentage>

right: 20px;
right: 10%;
right: auto;
  • <length>Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).
  • <percentage>Integer, followed by a percent sign (%). The value is a percentage of the height of the parent object.
  • autoDefault position, according to the regular HTML layout of the page.
.class {
  display: block;
  position: absolute;
  top: 50px; right: 100px; bottom: 50px; left: 100px;

Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.