Images
The <img> tag is used to display an image on a webpage.
<img src="image.jpg" width="300px">
- src – The src attribute tells the browser where to find the image.
- width – The width attribute sets the width of the image in pixels.
For example:
<img src="dog.jpg" width="300px">
An image stored on another website can be referenced using an absolute address.
An absolute address contains the full web address of the image.
<img src="https://superstudyparty.com/wp-content/uploads/2026/08/dog.avif" width="300px" >
An image stored in your website folder can be referenced using a relative address.
For example, if your files are organised like this:
website │ ├── home.html └── dog.jpg
You can use:
<img src="dog.jpg" width="300px">
An image stored in your website folder can be referenced using a relative address.
For example, if your files are organised like this:
website
│
├── home.html
│
└── images
└── dog.jpg
You can use:
<img src="images/dog.jpg" width="300px">