widthwidth*
*Contents  *Index  *Topic Contents
*Previous Topic: width
*Next Topic: wrap

width

Description

Sets or retrieves the width of the element.

Syntax

object.style.width[ = width]

Remarks

This read/write property is a string consisting of a floating-point number and a units designator, as described for cascading style sheets.

DIV and SPAN cannot be positioned unless a width is provided. Percentage values are based on the width of the parent element.

When scripting the width property, use either the pixelWidth or posWidth property for numeric manipulation of a width value.

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.

Applies To

HTML Tags APPLET, DIV, EMBED, FIELDSET, HR, IFRAME, IMG, INPUT, INPUT type=button, MARQUEE, OBJECT, SELECT, SPAN, TABLE, TEXTAREA
Scripting style

CSS Attribute

width


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