分享

offsetHeight Property (IHTMLElement)

 xiaoqdu 2008-11-28
IHTMLElement::offsetHeight Property

Retrieves the height of the object relative to the layout or coordinate parent, as specified by the IHTMLElement::offsetParent property.

Syntax

HRESULT IHTMLElement::get_offsetHeight(long *p);

Parameters

p
Pointer to a variable of type long that receives the height, in pixels.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

You can determine the location, width, and height of an object by using a combination of the IHTMLElement::offsetLeft, IHTMLElement::offsetTop, IHTMLElement::offsetHeight, and IHTMLElement::offsetWidth properties. These numeric properties specify the physical coordinates and dimensions of the object relative to the object's offset parent.

For more information about how to access the dimension and location of elements on the page through the Dynamic HTML (DHTML) Document Object Model (DOM), see Measuring Element Dimension and Location.

To comply with the Cascading Style Sheets, Level 1 (CSS1) World wide web link box model, Microsoft Internet Explorer 6 and later calculate the height of objects differently when you use the !DOCTYPE declaration in your document to switch on standards-compliant mode. This difference may affect the value of the IHTMLElement::offsetHeight propety. When standards-compliant mode is switched on, the IHTMLStyle::height property specifies the distance between the top and bottom edges of the bounding box that surrounds the object's content. When standards-compliant mode is not switched on, and with earlier versions of Windows Internet Explorer, the IHTMLStyle::height property also includes the IHTMLStyle::border and IHTMLStyle::padding belts that surround the object's bounding box. For more information, see CSS Enhancements in Internet Explorer 6.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约