Video heightProperty
Example
Modify the height of the video:
Try it Yourself »
Definition and Usage
The height property is used to set or return the value of the height attribute.
The height attribute describes the height of the video, in pixels.
Tip:It is a good habit 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 size of the video in advance, and thus cannot reserve suitable 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! Reducing a video via the height and width attributes only forces users to download the original video (even if it looks smaller on the page). The correct way is to compress the video with software before using it on a web page.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the height attribute.
Note:Internet Explorer 8 and earlier IE versions do not support the <video> element.
Syntax
Return the height property:
Set the height property:
Property Values
| Value | Description |
|---|---|
| pixels | Describes the height of the video, in pixels (e.g., width="100") |
Technical Details
| Return Value: | A number, representing the height of the video, in pixels. |
|---|
More Examples
Example
Get the height of the video:
Try it Yourself »
Related Pages
HTML Reference:HTML <video> height attribute
Video Object Other Extensions