English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete list of HTML tags

HTML: <video> width attribute

The width attribute of the <video> element specifies the width of the video player in pixels. Always specify both the height and width attributes of the video. If both height and width are set, the space required by the video is reserved when the page is loaded.

 HTML <video> tag

Online example

with specified height380px and280px video:

<video width="380" height="280" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the width attribute.

Note: Internet Explorer 8 and earlier IE versions do not support the <video> tag.

Definition and Usage

The width attribute specifies the width of the video player in pixels.
Tip: Always specify both the height and width attributes of the video at the same time. If both height and width are set, the space required by the video will be reserved when the page is loaded. However, if these attributes are not set, the browser will not know the size of the video and cannot reserve appropriate space for it. The result is that the page layout will change during loading (when the video is loading).
Note: Do not use the height and width attributes to resize videos! Using the height and width attributes to shrink the size of large videos will force users to download the original video (even if it looks small on the page). The correct way to resize videos is to use a program, then use it on the page.

HTML 4.01 from HTML5differences

The <video> tag is part of HTML5 New tag.

Syntax

<video width="pixels">

Attribute Value

ValueDescription
pixelsWidth value in pixels (for example "100px" or 100).
 HTML <video> tag