The HTML height attribute is used to specify the height of the Element. It can be used on the following elements:Â
Name
|
Description
|
<canvas>
|
The <canvas> element is used for drawing graphics dynamically.
|
<embed>
|
<embed> element embeds external content like multimedia within HTML documents.
|
<iframe>
|
<iframe> element embeds another webpage within an HTML document.
|
<img>
|
<img> element displays images within an HTML document.
|
<object>
|
<object> element embeds external content or plugins within HTML documents.
|
<input>
|
<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
id = "GeeksforGeeks"
width = "200"
height = "100"
style = "border: 1px solid black"
>
</ canvas >
</ body >
</ html >
|
Output:Â
HTML height Attribute Example Output
Supported Browsers: The browser supported by HTML height Attribute are listed below:Â Â
Last Updated :
08 Mar, 2024
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...