Image height attribute

Definition and usage

Height Attribute set or return the image's Height attribute Value.

Height attribute Specify the height of the image.

This attribute can also return the height of the image using CSS style settings (see the example below).

Tip:Use Width attribute Set or return the image's Width attribute value.

Example

Example 1

Change the height of the image to 300px:

document.getElementById("myImg").height = "300";

Try it yourself

Example 2

Return the height of the image:

var x = document.getElementById("myImg").height;

Try it yourself

Example 3

Change the height and width of the image to 300px and 450px respectively:

document.getElementById("myImg").height = "300";
document.getElementById("myImg").width = "450";

Try it yourself

Example 4

Return the height of the image using CSS style settings:

var x = document.getElementById("myImg").height;

Try it yourself

Syntax

Return height attribute:

imageObject.height

set height attribute:

imageObject.height = pixels

প্রতিশব্দ মূল্য

মূল্য বর্ণনা
pixels পিক্সেলের মাপে উচ্চতা (উদাহরণঃ height="100")

প্রযুক্তিগত বিবরণ

ফলাফল: সংখ্যা, চিত্রের উচ্চতা পিক্সেলে প্রদর্শিত

ব্রাউজার সমর্থন

চ্রোম এজ ফায়ারফক্স স্যাফারি ওপেরা
চ্রোম এজ ফায়ারফক্স স্যাফারি ওপেরা
সমর্থন সমর্থন সমর্থন সমর্থন সমর্থন

সংশ্লিষ্ট পাতা

HTML পরিচ্ছেদবিদ্যা ম্যানুয়াল:HTML <img> height প্রতিশব্দ