HTML image attributes |How to insert image in HTML

Techno HTML5

Insert image or Image src tag is a point to display the image on the HTML page that is known as embed image in html . Representation of documentation and include images on the web page is done by image attributes.
It is better for representation your content by showing the image on the web page related to the content.

Syntax -

 


Img src denotes the image resource where you want to display image on the webpage.

Image path from folder-

If you save the images in the images folder and want to display on the web page. You have specified the folder and image name and also its format



Syntax -
 


Image formats-

First of all, check the format of image that you are going to display on web page.
You can check the image formats from image property.
You can specify the image format as well as.

Formats-

jpg,png,gif,jpeg etc.



Syntax -
 
 
 
 


Image height and width

You can specify the height and width of the image-

Syntax-
 

Image Alt

The alt attribute is an essential attribute of an image. You should specify the image text via alt tag.

Syntax-
This is my image 

Example

The following example of image attributes will show you how to display an image on the webpage

HTML Image


<!DOCTYPE>
<html>
<head>
<title>Image attributes Tags </title>
</head>
<body>
<img src="images/myimage.jpg" alt="This is my image" height="200" width="300">

</body>
</head>
</html>
Run

Note-The images is a folder name where the all images are stored.