Language References
Sets or retrieves the object’s position relative to the right edge of the next positioned object in the document hierarchy.
CSS |
{ right: 'auto' | length | percentage } |
Script |
object.style.right [ = sRight ] |
auto |
Default position according to the regular HTML layout of the page. |
length |
Floating-point number and a valid CSS length unit: either an absolute units designator ( cm, mm, in, pt, pc, or px ) or a relative units designator ( em or ex ). |
percentage |
Value expressed as a percentage of the parent object’s height. |
The property is read/write with a default value of auto; the cascading stylesheet ( CSS ) attribute is not inherited.
This property is used with the position attribute.
When scripting the right property, use either the pixelRight or posRight property for numeric manipulation of a right value.
For more information about how to access the dimension and location of objects on the page through the document object model, see Measuring Element Dimension and Location.
The following sample demonstrates the use of the right attribute to set a DIV object 50 pixels from the right of the client area.
<div STYLE = "position:absolute; right:50px">
. . .
</div>
pixelRight, posRight