The width attribute on an <object> tag sets the width of the object element.
The width is specified in pixels -- without the ‘px‘ unit.
A width attribute on an <object> element.
This object has a width attribute and a CSS width property; CSS width takes precedence, i.e. wins.
<object data="/media/sample.pdf" type="application/pdf"
width="800" height="450" style="width:100%">
</object>
The width attribute sets the width of the object.
The width is defined in pixels, without the 'px' extension.
To define the width in % or other unit, use the CSS width property.
<object data="value" width="pixels">
Note: The width attribute requires that data has a value.
Value | Description |
---|---|
pixels | A number (e.g. 500). |
Here is when width support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |