position Property
Returns a String that represents the type of positioning used for the specified object.
expression.position
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
The String value for the position property can be one of the following:
Value | Description |
---|---|
empty
|
Object has no special positioning; it follows the layout rules of HTML. |
static
|
Object has no special positioning; it follows the layout rules of HTML. |
absolute
|
Object is positioned relative to parent element's position |
relative
|
Object is positioned according to the normal flow, and then offset by the top and left properties. |
For a script to move an element, the element must be defined to have relative or absolute positioning when it is created.
The position property is read-only. Use the setAttribute method to set the position property of the style attribute to one of the above values.
Example
The following example sets the style attribute's position property for the BODY element of the active document.
If ActiveDocument.body.Style.Position = "" Then
ActiveDocument.body.Style.setAttribute "position", "absolute"
End If