posTopposTop*
*Contents  *Index  *Topic Contents
*Previous Topic: posLeft
*Next Topic: posWidth

posTop

Description

Sets and retrieves the top position of the element in the units specified by the CSS top attribute. Unlike the top property, this property's value is a floating-point number, not a string.

Syntax

object.posTop[ = posTop]

Settings

This read-write property takes any valid floating-point number. Setting this property changes the value of the top position but leaves the units designator for the property unchanged.

Remarks

This property reflects the value of the CSS top attribute for positioned items. This property always returns zero for nonpositioned items since top does not mean anything unless the object is positioned. Use the offsetTop property to calculate actual positions within the document area.

For more information on how to access the dimension and location of elements on the page through the document object model, see Measuring Element Dimension and Location.

Example

The following JScript example moves the first IMG element up by 10 units.

document.all.tags("IMG").item(0).style.posTop -= 10;

Applies To

style

CSS Attribute

top

See Also

pixelTop


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.