Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

width attribute | width property

Gets or sets the width of the object.

This property is read/write.

HTML 4.01 Specification, Section 11.2.4Document Object Model (DOM) Level 2 HTML Specification

 

Syntax

HTML

<element width="pixels | percentage% | relative*" ... >

JavaScript

object.width = width

width = object.width

 

Property values

Type: Variant

TypeCondition
Integer

A width in pixels.

String

A String as described in the String Format section.

 

String format

pixels | percentage% | relative*

Standards information

 

 

Show:
© 2015 Microsoft