Saturday, July 16, 2016

What is an img tag in HTML and how we can display images from local and remote location?

In HTML it is possible to show images using img tag. The images can be from local or remote locations. Every image tag has a src attribute. The value of the src attribute can be from local or from remote locations. Following is an example of an image tag:

Image from remote location:
<img src="https://i.stack.imgur.com/cUizs.jpg">

Output


Image from local location:
In case of local location it needs to specify the correct path in the source attribute. See the example below:
<img src="c://photo/myphoto.jpg">

No comments:

Post a Comment