Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Reusing Browser Technology

IHTMLStyle2::get_position Method


This document describes technologies available in the Internet Explorer 5 Beta. While we encourage you to evaluate these features and to send us your feedback, please note that these features are subject to change.

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.

staticNo 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.
relativeThe 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.

IHTMLStyle2::put_position Method

This document describes technologies available in the Internet Explorer 5 Beta. While we encourage you to evaluate these features and to send us your feedback, please note that these features are subject to change.

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.

staticNo 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.
relativeThe 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!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site