Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Retrieves the type of positioning used for the object.
Syntax
HRESULT get_position( BSTR *p );
Parameters
- p
- Address of a string structure that contains the object's positioning.
static No special positioning; the object obeys the layout rules of HTML. absolute The object is positioned relative to the next positioned parent—or to the BODY if there isn't one—using the top and left properties. relative The object is positioned according to the normal flow and then offset by the top and left properties.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
Setting the property to absolute pulls the object out of the "flow" of the document and positions it irrespective of the layout of surrounding objects. If other objects already occupy the given position, they do not affect the positioned object, nor does the positioned object affect them. Instead, all objects are drawn at the same place, causing the objects to overlap. This overlap is controlled by using the z-index attribute or property. Absolutely positioned objects do not have margins, but they do have borders and padding.
Setting the property to relative places the object in the natural HTML flow of the document, but offsets the position of the object based on the preceding content.
Text and objects that follow a relatively positioned object occupy their own space and do not overlap the natural space for the positioned object. Contrast this with an absolutely positioned object, where subsequent text and objects occupy what would have been the natural space for the positioned object before the positioned object was pulled out of the flow.
Sets whether the table layout is fixed.
Syntax
HRESULT put_position( BSTR v );
Parameters
- v
- String (BSTR) that contains the position option to be set.
static No special positioning; the object obeys the layout rules of HTML. absolute The object is positioned relative to the next positioned parent—or to the BODY if there isn't one—using the top and left properties. relative The object is positioned according to the normal flow and then offset by the top and left properties.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
Setting the property to absolute pulls the object out of the "flow" of the document and positions it irrespective of the layout of surrounding objects. If other objects already occupy the given position, they do not affect the positioned object, nor does the positioned object affect them. Instead, all objects are drawn at the same place, causing the objects to overlap. This overlap is controlled by using the z-index attribute or property. Absolutely positioned objects do not have margins, but they do have borders and padding.
Setting the property to relative places the object in the natural HTML flow of the document, but offsets the position of the object based on the preceding content.
Text and objects that follow a relatively positioned object occupy their own space and do not overlap the natural space for the positioned object. Contrast this with an absolutely positioned object, where subsequent text and objects occupy what would have been the natural space for the positioned object before the positioned object was pulled out of the flow.
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.