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.


jpg,png,gif,jpeg etc.

Syntax -

Image height and width

You can specify the height and width of the image-


Image Alt

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

This is my image 


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

HTML Image

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

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

Please Share

Recommended Posts:-