CSS right Property
Description
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 syntaxobject.style.right
Syntax
Formal syntax: auto | <length> | <percentage> right: 20px; right: 10%; right: auto;
Values
- <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.
Example
.class { display: block; position: absolute; top: 50px; right: 100px; bottom: 50px; left: 100px; }
Browser Support
1+![]() | 5.5+![]() | 1+![]() | 1+![]() | 5+![]() |
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.