Please note, this is a STATIC archive of website technosmarter.com from July 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
 

HTML image attributes


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 the representation of 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>
<html>
<head>
<title>Image attributes Tags </title>
</head>
<body>
<img src="images/myimage.jpg" alt="This is my image" height="200" width="300">
</body>
</html>
Run

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


Please Share

Recommended Posts:-