Export (0) Print
Expand All
top
Expand Minimize
This topic has not yet been rated - Rate this topic

top property

Sets or retrieves the position of the object relative to the top of the next positioned object in the document hierarchy.

CSS 2.1, Section 9.3.2

Syntax

Integer value = object.put_top(Variant v);Integer value = object.get_top(Variant* sTop);

Property values

Type: VARIANT

one of the values listed in Possible Values.

auto (auto)

Default. Default position according to the regular HTML layout of the document.

length (length)

Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For more information about the supported length units, see CSS Values and Units Reference.

percentage (percentage)

Integer, followed by a percent sign (%). This value is a percentage of the height of the parent object.

String format

<length> | <percentage> | auto

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Value

Standards information

Remarks

The IHTMLCSSStyleDeclaration::top attribute should be used only when the IHTMLCSSStyleDeclaration::position attribute is set; otherwise, the value of the IHTMLCSSStyleDeclaration::top attribute is ignored.

Because the value of the IHTMLCSSStyleDeclaration::top property is a string, you cannot use the property to calculate the position of the object in the document.

For more information about how to access the dimension and location of objects on the document through the Dynamic HTML (DHTML) Document Object Model (DOM), see Measuring Element Dimension and Location with CSSOM in Internet Explorer 9.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

Reference
IHTMLStyle::pixelTop
IHTMLStyle::posTop

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.