style.width (Property)

The width of a styled element.

Availability:

CSS level - 1
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.width
CSS syntax:width: aWidth
Argument list:aWidthAn object width

The object space is defined by an extent rectangle that surrounds the space occupied by it on the screen. An extent rectangle is that smallest rectangle that completely encloses the item. This property specifies the width of that extent rectangle.

When used to read the width of an object, this returns a value in pixel units with the px suffix.

You can also use this property to change the width of a styled element.

The normal range of values specified in measurement units can be used. You can also assign the auto keyword to let the browser deduce the width of an object from the document source.

Warnings:

See also:JSSTag.width, Measurement units, style.height, style.pixelWidth, style.posWidth