Add alt text and size attributes to an image

Description: Improve this image tag. The picture shows a blue backpack on a table.

<img src="IMG_0023.JPG">

Hint:

  • Rename the file, add alt, width and height. Add lazy loading if the image is not at the top of the page.

Solution

<img src="blue-backpack-on-table.webp" alt="Blue backpack on a wooden table" width="800" height="600" loading="lazy">

How it works

  • The file name describes the picture, in lowercase with hyphens.
  • The alt text describes it in a short natural sentence, without keyword stuffing.
  • Width and height reserve the space, so the layout does not jump (CLS).
  • loading="lazy" delays the loading until the user scrolls near it. Do not use it for the main image at the top.

Read Images.


Learn more about the similar topics:
Tutorials
SEO – Domain Names
SEO – URLs and File Names
SEO – Title Tag
SEO – Meta Description
SEO – Headings
SEO – Content Writing
SEO – Images
Exercises & Assignments
Write a title tag and meta description for a web page
Create SEO friendly URLs from page titles
Fix the heading structure of a page
Add alt text and size attributes to an image
Rewrite weak anchor texts
Interview Questions & Answers
What is on-page SEO?
What is a meta description?
What is a title tag and what is its ideal length?
What is alt text and why is it important for SEO?
What is anchor text?