Last Updated : 11 Jul, 2025
The HTML height attribute is used to specify the height of the Element. It can be used on the following elements:
Name
Description
The <canvas> element is used for drawing graphics dynamically.
<embed> element embeds external content like multimedia within HTML documents.
<iframe> element embeds another webpage within an HTML document.
<img> element displays images within an HTML document.
<object> element embeds external content or plugins within HTML documents.
<input> element allows user input within forms in HTML documents.
Syntax
<element height="value" >
Example 1: In this example we the HTML height attribute sets the height of a canvas element, defining its vertical dimension, often used for rendering graphics or animations.
HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML height Attribute</title>
</head>
<body>
<h2>HTML height Attribute</h2>
<!-- canvas Tag starts here -->
<canvas id="GeeksforGeeks"
width="200"
height="100"
style="border: 1px solid black">
</canvas>
<!-- canvas Tag ends here -->
</body>
</html>
Output:
HTML height Attribute Example OutputSupported Browsers: The browser supported by HTML height Attribute are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4