Add Image in an HTML file

Almost all websites contain Images. The HTML < img > tag is used for embedding images into an HTML document. The < img > tag require minimum one attribute - SRC , and it has no end tag like < br > tag. <img src="picture1.jpg">

HTML Image Source

The attribute Src stands for source of your Image location, that telling the browser where to go to find the Image . The value of the src attribute is the URL of the Image you want to display. The src attribute ' s value can be any valid URL of an image on the Web , local or remote.

HTML Image Formats

You can use .jpg, .gif and .png format in your HTML file. Images are not part of the HTML file by technically, they are separate files which are inserted into the page when it is viewed by a browser. A simple web page with one image is actually two files - the HTML file and the image file.

<img src="picture1.jpg>

In the above case the picture1.jpg is in the same directory of your html file.

<img src="http://www.corelangs.com/logo.png">

In the above case the image is loaded from another website location, so you should given full path of the image location.

html-image

HTML Source Code :

<html> <body > <img src="http://www.corelangs.com/logo.png"> </body> </html>

Note: If you insert more images on your web page , it will take more time to load the page completely. So whenever you deal with images use it carefully.