How to Set Image Height in HTML Using the Tag

 

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

 

how to use the image tag in html with example

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

<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>

How to Set Image Height in HTML Using <img> 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_CE1xfUxMPj21UiONgeXdLbWZJ
74WPtLoWsddy8bR-
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

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

Related Post :-

how to create checkbox in html

html italic tag

how to create checkbox in html

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

html script tag attributes

CSS text-emphasis-color Property

HTML Input Type Submit Syntax and Example

CSS Padding Property Explained

How to Display T Pattern in C with Star (*) – Step-by-Step