CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

CSS right Property

CSS right Property

 

 

The right property is used to change the horizontal position of a positioned element. It does not work on non-positioned elements.

  1. If position is absolute or position is fixed then the right property sets the right edge of an element to a unit to the right of the right edge of its nearest positioned ancestor.
  2. If position is relative then the right property sets the right edge of an element to a unit to the left/right of its normal position.
  3. If the position is sticky then the right property behaves like its position is relative when the element is inside the viewport, and like its position is fixed when it is outside.
  4. If the position is static then the right property has no effect.

 

Default Value:-

 

Its default value is auto.

 

Syntax:-

 

Its syntax is:- right: auto | length | initial | inherit;

 

Further Explanation:-

 

Value Description
auto Lets the browser calculate the right edge position.
length Sets the right edge position in px, cm, etc.
% Sets the right edge position in % of containing element.
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Properties

All Sections related to CSS