Width Attribute

HTML (DHTML)

Width Attribute

Internet Development Index

Defines the width of the shape. Read/write String.

Applies To

Shape

Tag Syntax

<v:element style="width: expression">

Script Syntax

element.style.width="expression"

expression=element.style.width

Remarks

The Width attribute is similar to the standard HTML Width attribute for styles.

Units may be mapped to the parent element or may be in absolute units.

Values include:

Value Description
Auto Default position of an element in the flow of the page.
units A number with an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). If no units are given, pixels (px) is assumed.
percentage Value expressed as a percentage of the parent object's width.

VML Standard Attribute

See Also

Units

Example

The width of the shape is 25.

   <v:rect id=myrect fillcolor="red"
   style="position:relative;top:1;left:1;width:25;height:20">
   </v:rect>

Width Attribute Example. (Requires Microsoft Internet Explorer 5 or greater.)