insert image in html code

How to insert an image in html

Are you a beginner?, trying to insert an image in your HTML code, so don’t worry you are at the right place.

Before starting always keep in mind we have to use HTML <img> tag to insert image in any HTML code. In this tag we have to define the image path with src=”image.jpg” attribute.

<img src="image.jpg" alt="image" />

An image makes a web page more impressive that’s why we use tag to place an image on a web page. If you’re not more familiar with html so you should know how to add link on image in html.

If you are still in trouble how to insert an image in html so follow some steps.

How to write html image code

Step: 1 Create a directory

Create a new directory or folder in your system where you are writing html document. Now give a name to that directory or folder like images. Identify first your image directory path if you give the wrong path image will not show on your web page. Find your image directory location in your system’s address bar.

Create a directory

Step: 2 Add full path of your image

Add your image path to your html document where you to show the image. After adding your directory path now write your image name with an extension like jpg, jpeg or png.

<img src="/images/apple.jpg" alt="apple" />

Step: 3 Check the path and save

Verify your image path is correct then save your html document and run it into the browser.

Want to Get Good Website? Please Fill the Form