HTML
Example
A video with a specified height and width:
Try it »
Browser support





All major browsers support the width property.
Note: Internet Explorer 8 and earlier IE versions are not supported.
Definition and Usage
The width attribute specifies the width of the video player.
Tip: It is a good practice to specify the height and width of a video. If these attributes are set, space is reserved for the video when the page loads. If they are not set, the browser cannot determine the video's dimensions in advance and cannot reserve appropriate space, so the layout may change while the page is loading.
**Note:** Do not use the height and width attributes to scale the video! Shrinking the video via the height and width attributes only forces the user to download the original video (even though it appears smaller on the page). The correct method is to compress the video with software before using it on the web page.
Differences between HTML 4.01 and HTML5
Syntax
Attribute values
| Value | Description |
|---|---|
| pixels | A width value in pixels (such as "100px" or 100). |
HTML