Inserting Image in HTML

For a web page, images are necessary and atleast one image is useful for SEO as well. To insert images in an HTML web page, use the <img> tag.

To add an image, include an img tag and set the image source i.e.

Add images anywhere in the HTML document. Above, we used the,

  • src attribute to set the image source,
  • alt for alternate text,
  • width for image width
  • height for image height.

Note: img tag is an empty tag. Do not use a closing tag. It is not required.

With that, add the image tag inside the <body>…</body> tag always,

The following is an example to add image in an HTML web page,

The output:

Inserting Image

More Examples


Page links in an HTML Web Page
Add Title in an HTML web page
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading