How to insert image

 





Image insert:- The  <img> is use to insert image in html. This is an empty tag, so you don't need to close the tags .

If you use this tag then you have to define its width and height and alt.

What is alt?
Ans:- alt is use to name the image . Suppose when you internet connection is slow the image loads very slowly and sometimes is don't loads but there is some name written in that image, for that alt tag is use.

Things you need to understand first before insertion image to your web page.

First the image and the main html file should be in the same location then this process will work.
For example: You have a folder where you save your .html file named as html. So you need to make a sub-folder in that html folder and name the folder as image.
So that the path will be clear to insert image like html/images/image.jpg

Code for image insert:-

<html>
<head>
<title>image</title>
</head>
<body>
<h2>my first image insert</h2>

<img src="html/images/image.jpg" alt="image 1" width="200px" height="100px">

</body>
</html>

0 comments: