HTML <video> heightProperty

HTML <video> Tag

Example

Video with specified height and width:

<video width="320" height="240" controls>
  <source src="movie.mp4.html" type="video/mp4">
  <source src="movie.ogg.html" type="video/ogg">
Your browser does not support the video tag.
</video>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the height attribute.

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


Definition and Usage

The height attribute specifies the height of the video player, in pixels.

Tip:It is a good practice to specify the height and width of a video. If these attributes are set, space will be reserved for the video when the page loads. If these attributes are not set, the browser cannot determine the video's dimensions in advance, and thus cannot reserve appropriate space for the video. As a result, the layout will change during page loading.

Note:Do not use the height and width attributes to scale videos! Using the height and width attributes to shrink a video will only force users to download the original video (even if it looks smaller on the page). The correct approach is to use software to compress the video before using it on a web page.


Differences between HTML 4.01 and HTML5

The <video> tag is a new HTML5 tag.


Syntax

<video height="pixels">

Property value

Value Description
pixels The height value in pixels (such as "100px" or 100).


HTML <video> Tagother extensions