Horje
What is HTML height Attribute

Definition and Usage

The height attribute specifies the height of the element, in pixels.


Applies to

The height attribute can be used on the following elements:

Elements Attribute
<canvas> height
<embed> height
<iframe> height
<img> height
<input> height
<object> height
<video> height

Browser Support

The height attribute has the following browser support for each element.


How to add A <canvas> element with a height and width of 200 pixels

Canvas Example.
index.html
Example: HTML
 <canvas id="myCanvas" width="200" height="200" style="border:1px solid"> 

Output should be:

How to add A <canvas> element with a height and width of 200 pixels

How to add A flash animation with a height and width of 200 pixels

Embed Example.
index.html
Example: HTML
 <embed src="helloworld.swf" width="200" height="200"> 

Output should be:

How to add A flash animation with a height and width of 200 pixels

How to add An <iframe> with a specified height and width of 200 pixels

Iframe Example.
index.html
Example: HTML
 <iframe src="https://horje.com" width="200" height="200">
</iframe> 

Output should be:

How to add An <iframe> with a specified height and width of 200 pixels

How to add An image with a height and width of 42 pixels

Img Example.
index.html
Example: HTML
 <img src="smiley.gif" alt="Smiley face" height="42" width="42"> 

Output should be:

How to add An image with a height and width of 42 pixels

How to Define an image as the submit button, with height and width attributes

Input Example.
index.html
Example: HTML
<form action="/action_page.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="image" src="https://horje.com/avatar.png" alt="Submit" width="48" height="48">
</form>

Output should be:

How to Define an image as the submit button, with height and width attributes

How to add A flash animation with a height and width of 400 pixels

Object Example.
index.html
Example: HTML
<object data="https://horje.com/avatar.png" width="300" height="200"></object>

Output should be:

How to add A flash animation with a height and width of 400 pixels

How to add A video player with a specified height and width

Video Example.
index.html
Example: HTML
<video width="320" height="240" controls>
  <source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_2mb.mp4" type="video/mp4">
  <source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_2mb.mp4" type="video/ogg">
  Your browser does not support the video tag.
</video>

Output should be:

How to add A video player with a specified height and width




html height attribute

Related Articles
How to add HTML accept Attribute HTML Input HTML Attribute
How to add HTML accept-charset Attribute HTML Attribute
What is HTML accesskey Attribute HTML Attribute
What is HTML action Attribute HTML Attribute
What is HTML alt Attribute HTML Attribute
What is HTML async Attribute HTML Attribute
What is HTML autocomplete Attribute in HTML HTML Attribute
What is HTML autofocus Attribute HTML Attribute
What is HTML autoplay Attribute HTML Attribute
What is HTML charset Attribute HTML Attribute
What is HTML checked Attribute HTML Attribute
What is HTML cite Attribute HTML Attribute
What is HTML class Attribute HTML Attribute
What is HTML cols Attribute HTML Attribute
What is HTML colspan Attribute HTML Attribute
What is HTML content Attribute HTML Attribute
What is HTML contenteditable Attribute HTML Attribute
What is HTML controls Attribute HTML Attribute
What is HTML coords Attribute HTML Attribute
What is HTML data Attribute HTML Attribute
What is HTML data-* Attribute HTML Attribute
What is HTML datetime Attribute HTML Attribute
What is HTML controls Attribute HTML Attribute
What is HTML default Attribute HTML Attribute
What is HTML defer Attribute HTML Attribute
What is HTML dir Attribute HTML Attribute
What is HTML dirname Attribute HTML Attribute
What is HTML disabled Attribute HTML Attribute
What is HTML download Attribute HTML Attribute
What is HTML draggable Attribute HTML Attribute
What is HTML enctype Attribute HTML Attribute
What is HTML enterkeyhint Attribute HTML Attribute
What is HTML for Attribute HTML Attribute
What is HTML form Attribute HTML Attribute
What is HTML formaction Attribute HTML Attribute
What is HTML headers Attribute HTML Attribute
What is HTML height Attribute HTML Attribute
What is HTML hidden Attribute HTML Attribute
What is HTML high Attribute HTML Attribute
What is HTML href Attribute HTML Attribute
What is HTML hreflang Attribute HTML Attribute
What is HTML http-equiv Attribute HTML Attribute
What is HTML id Attribute HTML Attribute
What is HTML inert Attribute HTML Attribute
What is HTML inputmode Attribute HTML Attribute
What is HTML ismap Attribute HTML Attribute
What is HTML kind Attribute HTML Attribute
What is HTML label Attribute HTML Attribute
What is HTML lang Attribute HTML Attribute
What is HTML list Attribute HTML Attribute
What is HTML loop Attribute HTML Attribute
What is HTML low Attribute HTML Attribute
What is HTML max Attribute HTML Attribute
What is HTML maxlength Attribute HTML Attribute
What is HTML media Attribute HTML Attribute
What is HTML method Attribute HTML Attribute
What is HTML min Attribute HTML Attribute
What is HTML multiple Attribute HTML Attribute
What is HTML muted Attribute HTML Attribute
What is HTML name Attribute HTML Attribute
What is HTML novalidate Attribute HTML Attribute
What is HTML onabort Attribute HTML Attribute
What is HTML onafterprint Attribute HTML Attribute
What is HTML onbeforeprint Attribute HTML Attribute
What is HTML onbeforeunload Attribute HTML Attribute
What is HTML onblur Attribute HTML Attribute
What is HTML oncanplay Attribute HTML Attribute
What is HTML oncanplaythrough Attribute HTML Attribute
What is HTML onchange Attribute HTML Attribute
What is HTML onclick Attribute HTML Attribute

Single Articles
How to add A <canvas> element with a height and width of 200 pixelsHTML Attribute
How to add A flash animation with a height and width of 200 pixelsHTML Attribute
How to add An <iframe> with a specified height and width of 200 pixelsHTML Attribute
How to add An image with a height and width of 42 pixelsHTML Attribute
How to Define an image as the submit button, with height and width attributesHTML Attribute
How to add A flash animation with a height and width of 400 pixelsHTML Attribute
How to add A video player with a specified height and widthHTML Attribute

Read Full:
HTML Attribute
Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded:
1 week ago
Uploaded by:
Admin
Views:
27


Reffered: https://www.w3schools.com/tags/att_height.asp

Share on: