right Attribute | right Property

DHTML, HTML, & CSS

right Attribute | right Property


Sets or retrieves the position of the object relative to the right edge of the next positioned object in the document hierarchy.

Syntax

HTML{ right: sPosition }
Scriptingobject.style.right [ = sPosition ]

Possible Values

sPosition String that specifies one of the following values:
autoDefault position according to the regular HTML layout of the page.
lengthFloating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). For more information about the supported length units, see CSS Length Units.
percentageInteger, followed by a %. The value is a percentage of the width of the parent object.

The property is read/write with a default value of auto; the cascading style sheets (CSS) attribute is not inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

Only use the right attribute when the position attribute is set; otherwise, the value of the right attribute is ignored.

You cannot use the right property in script to calculate the position of the object in the document, because the value of the right property is a string. Instead, use the pixelRight property or the posRight property.

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 locationInternet Link.

Example

This example uses the right attribute to set a DIV object 50 pixels from the right of the client area.

<DIV STYLE = "position:absolute; right:50px">
. . .
</DIV>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BUTTON, CENTER, CITE, CODE, currentStyle, DD, DFN, DIR, DIV, DL, FIELDSET, 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, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OBJECT, OL, P, PRE, runtimeStyle, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, XMP

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.