The CSS right property mainly affects the horizontal position of the element as well as CSS property does not affect non-positioned elements.
Syntax:
right: auto|length|initial|inherit;
Property values:
- auto: This is a default property in which the browser will calculate the right edge position.
Syntax:
right:auto;
Example-1:
Output:
👁 Image
- length: Length help to set the right edge position of element in px, cm. It should always have positive value.
Syntax:
right:length;
Example-2:
Output:
👁 Image
- initial: Initial keyword is used to set default value of CSS property.
Syntax:
right:initial;
Example-3:
Output:
👁 Image
- inherit: Inherit keyword is also used to set default value of CSS property.Here default value is the set value of previous element.
Syntax:
right:inherit;
Example-4:
Output:
👁 Image
Supported Browsers: The supported browsers by right Property are listed below:
- Google Chrome 1.0
- Edge 12
- Firefox 1.0
- Internet Explorer 5.5
- Opera 5.0
- Safari 1.0