How to Set Image Height in HTML Using the Tag

 

How to Set Image Height in HTML Using the <img> Tag

 web designing theory

html image Height tag 

Image with Height

<img src="logo.jpg" height="400">

  • This sets the image height to 200 .
  • The width adjusts proportionally .


Syntax :-

Table width in pixel : <table border =1 height= 400>

html image Height tag 

    Example :-


<!Doctype html>

<html>
    <body>

<table border= 1  height="400" >

<tr><td>

<img src="https://blogger.googleusercontent.com/img/b/
R29vZ2xl/AVvXsEh1E1OaKNSdVjTgeUNPTOydfZBZczSKbGcnedJq-A-RRs-LXAsghsog5Le-
RUXQq3_IAitSkCmybb9H0WVpdpoVyvcR2jYfxlatb_CE1xfUxMPj21UiONgeXdLbWZJ74WPtLoWsddy8bR-
BXd9JlXU4F7RWbxNBJ5x-_jkrQauMOFLifXQk90-holf9aUzF/w320-h268/logo.jpg">

</td>
</tr>

</table>

</body>

</html>

How to Set Image Height in HTML Using the <img> Tag

Explain Program

Step 1 ]

<!DOCTYPE html>

  •  document type declaration.
  • browser help this is an HTML5 document.

Step 2 ]  

. <html> ... </html>

  • root element of the HTML document.
  • <html> tag is part of the web page.

Step 3 ]  

<body> ... </body>

<table border=1 height="400">

create a table 

border =1 border 1 pixel around table.

height = "400" set table height to 400 

 Step 4]  

<tr><td>.....</td></tr>
  one table row(<tr>) with one cell(<td>)
  <td>  inside the image 

How to Set Image Height in HTML Using the <img> Tag 

OUTPUT

https://webdesigningtheory.blogspot.com/

Related Post :-

how to create checkbox in html

html italic tag

how to create checkbox in html

Comments

Popular posts from this blog

What Is CSS Text Color in 2026

CSS Padding Property Explained

CSS Outline Color Property in 2026