---
title: "How to set image on page in HTML?"  
description: "How to set image on page in HTML?"  
author: "Steilla Mitchel"  
published: 2024-06-05  
updated: 2024-06-05  
canonical: https://www.mindstick.com/forum/160679/how-to-set-image-on-page-in-html  
category: "html"  
tags: ["html", "html5", "html img"]  
reading_time: 1 minute  

---

# How to set image on page in HTML?

How to set [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) on [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page) in [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript)?

## Replies

### Reply by Ashutosh Patel

## Show image on HTML Page

HTML provides the built-in tag for showing images on an HTML webpage

## HTML <img> tag

To set an image on a web page in HTML, you can use the `<img>` tag.

## Syntax-

<img src= “image-path”/>

## Example-

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Image Example</title>
</head>
<body>
    <div>
      <h2>Showing image on the page</h2>
        <img src="nature-img.jpg" alt="nature-img" width="300" height="300" />
    </div>
</body>
</html>
```

## Output-

![How to set image on page in HTML?](https://www.mindstick.com/mindstickforums/c891c910-1284-411b-a506-1ef2f5e37c48/images/e284ca95-a172-4291-b001-5c02e7ec7b2b.png)

## Explanation-

1. The **<img>** tag is used to embed an image in an HTML document.
2. The **src** attribute specifies the URL **(path)** to the image file.
3. The **alt** attribute provides alternative text for the image, which is displayed if the image cannot be loaded or for accessibility purposes.
4. You can also adjust the **width** and **height attributes** to resize the image if needed.

That's it! When you open the HTML file in a web browser, the image will be displayed on the page.


---

Original Source: https://www.mindstick.com/forum/160679/how-to-set-image-on-page-in-html

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
