CSS position right property
CSS Position right Property
Description
The left property is used to position an element. The right property allows you to specify an element’s offset from the left side of its containing block (for absolute positioning) or from the right side of where the element itself should normally appear (for relative positioning).
Possible Values
- length – A fixed distance from the right side of the positioning context.
-
percent – A percentage relative to the width of the positioning context, assuming the context’s width has been explicitly set.
-
auto – Default. Let the browser calculate the left position.
Applies to
All HTML positioned elements.
DOM Syntax
object.style.right = "2px";
Example
Here is an example showing the effect of this property.
<html>
<head>
</head>
<body>
<p style = "position:absolute; right:100px;">
This line will be positioned 100px away from the right edge of this window.
</p>
</body>
</html>
It will produce the following result −