Open In App

HTML <video> height Attribute

The height attribute in the HTML <video> element specifies the height of the video player in pixels, controlling the vertical size of the video display area within the webpage.

HTML <video> height Attribute Syntax:

<video height="pixels">

HTML <video> height Attribute Values:

It contains single-value pixels which set the height of the video frame.



HTML <video> height Attribute Example:

Here is an example of using the HTML <video> height Attribute to set the height of the webpage.




<!DOCTYPE html>
<html>
  
<head>
    <title>HTML video height Attribute</title>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
          GeeksforGeeks
        </h1>
  
        <h3>HTML video height Attribute</h3>
  
        <video width="400" 
               height="200" 
               controls>
            <source src=
                type="video/mp4">
            <source src=
                type="video/ogg">
        </video>
    </center>
</body>
  
</html>

Output:



HTML <video> height Attribute Example Explanation:

Note:

Downsizing a large size video with the height and width attributes forces users to download the original video. The best way to rescale videos is with a program, before using it on a page.

HTML <video> height Attribute Use cases:

1. How to set the height and width of the video player in HTML5 ?

Use the <video> element with attributes width and height, specifying pixel values to set dimensions for the player.

2.How to add video in HTML5 ?

Use <video> element with attributes width and height, providing video sources with <source> tags inside, specifying file paths and MIME types for compatibility.

HTML <video> height Attribute Supported Browsers:

The browser supported by HTML <video> height Attribute are listed below:


Article Tags :