CSS right

The right property in CSS is used to specify the positioning of an element relative to its containing element.

The syntax for using the right property is as follows:


selector {
    right: value;
}

Where selector is the selector for the element you want to apply the right property to, and value is the distance from the right edge of the containing element that you want the element to be positioned.

For example, if you want to position an element 50 pixels from the right edge of its containing element, you would use the following CSS:


.example {
    position: absolute;
    right: 50px;
}
Result:

In this example, the element with the class example is positioned 50 pixels from the right edge of its containing element.

You can also use the right property in combination with other positioning properties, such as top, bottom, and left, to create complex layouts.

Remember that in order for the right property to work, the element must have a positioning value other than static, such as absolute or fixed.