Gets the width of the object.
HRESULT IHTMLCurrentStyle::get_width(VARIANT *p);
- Pointer to a variable of type VARIANT of type VT_BSTR that receives one of the values listed in Possible Values.
auto Default. Default width of the object. width Floating-point number, followed by an absolute units designator (
pc) or a relative units designator (
px). For more information about the supported length units, see CSS Length Units.
percentage Integer, followed by a %. The value is a percentage of the width of the parent object, whether or not it is specified explicitly. Negative values are not allowed.
Returns S_OK if successful, or an error value otherwise.
As of Microsoft Internet Explorer 6, when you use the !DOCTYPE declaration to specify standards-compliant mode, this property specifies the distance between the left and right edges of the content box—that is, within the IHTMLStyle::padding.
When the !DOCTYPE declaration does not specify standards-compliant mode, and with earlier versions of Windows Internet Explorer, this property includes the object's content box, plus the values of the following properties: IHTMLStyle::borderLeft, IHTMLStyle::borderRight, IHTMLStyle::paddingLeft, and IHTMLStyle::paddingRight. Subtracting the sum of the values of these properties from the value of the IHTMLCurrentStyle::width property equals the width of the parent object's content box.
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 with CSSOM in Internet Explorer 9.
CSS Enhancements in Internet Explorer 6, Measuring Element Dimension and Location with CSSOM in Internet Explorer 9