Click to return to the DHTML, HTML     
height Attribute | height...     hidden Property     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

HEIGHT Attribute | height Property


Sets or retrieves the height of the object.

Syntax

HTML<ELEMENT HEIGHT = sHeight ... >
Scriptingobject.height [ = sHeight ]

Possible Values

sHeight String that specifies one of the following values:
heightInteger that specifies the height of the object, in pixels.
percentageInteger, followed by a %. The value is a percentage of the height of the parent object.

The property is read/write with no default value.

Remarks

If the height property of an IMG is specified, but the width property is not specified, the resulting width of the IMG is sized proportionally according to the specified height property and the actual width (in pixels) of the image in the source file.

Consider the following:

Dimensions of image in source file (pixels):100 X 50 (W X H)
Specified image height:2in
Specified image width:not specified
Resulting image height:2in
Resulting image width:4in ((100 / 50) * 2 inches)

If you specify the height property of an IMG, and the height and width of the image in the source file are identical, the width of the image will match the height.

If you specify the height property and the width property of an IMG, the resulting image dimensions will match those specified.

Percentage values are based on the height of the parent object.

When scripting the height property, use either the pixelHeight or posHeight property to numerically manipulate the height value.

This property specifies the calculated height of the object, in pixels. For table rows and table cells, this property has a range of 0 to 32750 pixels.

If you set the value of the corresponding HTML attribute using a percentage, this property will specify the height, in pixels, represented by that percentage.

The scripting property is read/write for the IMG object, but read-only for other objects.

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

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
EMBED, FRAME, IMG, MARQUEE, OBJECT, TABLE, TD, TH, TR

See Also

width



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

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