Sets the position of the object relative to the right edge of the next positioned object in the document hierarchy.
Syntax
{ right: sPosition }
Possible values
sPosition
Variant that specifies or receives one of the following values:
auto | Default. Position is determined by the regular HTML layout of the page. |
length | Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For more information about the supported length units, see Length units reference. |
percentage | Integer, followed by a percent sign (%). The value is a percentage of the width of the parent object. |
The property has a default value of auto. It is not inherited.
Remarks
Only use the right property when the position property is set; otherwise, the value of the right property is ignored.
Example
This example uses the right property to set a DIV object 50 pixels from the right of the positioning context in which it resides:
![]() | |
---|---|
<div style = "position:absolute; right:50px"> . . . </div> |
Standards information
This property is defined in Cascading Style Sheets (CSS), Level 2 (CSS2).
Applies to
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BUTTON, CENTER, CITE, CODE, DD, DFN, DIV, DL, FIELDSET, FONT, FORM, HN, HR, I, IFRAME, IMG, INPUT TYPE=BUTTON, INPUT TYPE=CHECKBOX, INPUT TYPE=FILE, INPUT TYPE=IMAGE, INPUT TYPE=PASSWORD, INPUT TYPE=RADIO, INPUT TYPE=RESET, INPUT TYPE=SUBMIT, INPUT TYPE=TEXT, LAYOUTRECT, LI, OBJECT, OL, P, S, SELECT, SPAN, SUB, TABLE, TT, U, UL, VAR, XMP