Img Src Attribute
<img src> attribute refers to the source of the image you want to display. The
img tag will not display an image without the
src attribute. However, if you set the source to the location of the image, you can display any image.
There is an image of the freeCodeCamp Logo located at
You can set that as the image using the
<html> <head> <title>Img Src Attribute Example</title> </head> <body> <img src="https://avatars0.githubusercontent.com/u/9892522?v=4&s=400"> </body> </html>
The above code displays like this:
src attribute is supported by all browsers.
You can also have a locally hosted file as your image.
<img src="images/freeCodeCamp.jpeg> would work if you had a folder called
images which had the
freeCodeCamp.jpeg inside, as long as the ‘images’ folder was in the same location as the