Showing posts with label how to add image code in html html image code. Show all posts
Showing posts with label how to add image code in html html image code. Show all posts

Thursday, November 2, 2023

how to add image tag in html

 How To Add  Image Tag In Html 


HTML IMAGE TAG CODE




Q] What Is The  Image  Tag  In  HTML?


  1.  The  HTML  tag is used to display an image on a web page .
  2.  It is a self -closing tag.
  3.  which means it does not need a separate closing tag
  4.  The <img> tag used embed an image in HTML page.
  5.  Image are not technically  insert into a web page.
  6.  image are linked in to the web pages.
  7. The <img> tag is empty it contains attributes only and does not have a closing tag.

Syntax :-


 <img src="image_path" alt="alternative -text" >


Q] What Are Image  Tag.?

Image tagging is process of identifying and labeling the contents of an image tag 
This can be done manually by someone looking at the image and typing in description/ 
automatically using machine


Html IMG Attribute :-


 1] src :-

  •  src is used to specify the path to the image.
  •  It is a necessary  attribute that describes source or path of the image.
  • It instructs the browser  look for the image on the server .
  • specifies the path to the image.

 2] alt :-

  •    The alt attribute defines an alternate  text for the image it cant be displayed .
  •  The value of the alt attribute describe the image information the image in words.

  • The alt attribute is considered best /good SEO prospective.

   3] Width :-

  • width is an optional attribute which is used to specify the width to display the image.                                                              
  • It is used to specify width of the image.

Height :-

  •  height is used to specify the height of the image

 

Syntax:-

  <img src=" image-path" alt" image-info" width="image-width-put" 

   height=" image-height-put">

Program :-

<!DOCTYPE html>
<html>
<head>
   
    <title>image html tag</title>
</head>
<body>
   <h2>html tag </h2>
<img src=
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTU_
ej9ZY8Ee051iV1P0wHZhhlCLdN1nZfGZQ&usqp=CAU"
alt="nature" width="" height="">
</body>
</html>


Output:-   

img


👉👉

 VISIT THE LINK

👍👍 

html-anchor-tag