Adding images in HTML

In this post lets see how to add images in HTML Documents.  To add image you need a special tag called as img tag. And its special because you don’t need to use the end tag or closing tag.

That means instead of using this code :

What we will be using is the code given below.
Just by transferring forward slash or f-lash to the end of the opening tag.

Now if we go ahead and add something like this :

It wouldn’t result in anything significant but just a blank page. So to add an image, we need to add attribution to our img tag. The attribute which we are going to add is src. Now src isn’t that difficult. It simply means source. So you can add src just like any other attribute. See the code below:

Now in the above code we have our tag ready. And to add a image you just need to specify the URL of the image between the quotation marks. So if you need to add image of codefap logo then just copy the url of the image. Which is : http://www.codefap.com/wp-content/uploads/2012/10/Web-logo.png

After copying the URL, just paste it between quotation marks. So the final code will be :

And it would look like this :

If you have any doubts, feel free to leave a comment below. I would reply as soon as possible. Or you can watch my video tutorial for adding images to html documents :

Click here to watch How to Add Images to HTML Documents

Leave a Reply