HTML · Lesson 3 of 4
Add an image and describe it
Use img to add an image. Put its filename in src and a description in alt. The description helps people who cannot see the image, and appears if it fails to load.
Your task
Choose an image from your computer, then write a description of what it shows. Run the code to see it.
Each new lesson builds on your personal page. Your saved lesson draft opens when you return.
The image stays in your browser. Choose it before running; its filename replaces the example filename.
Your page
Checks use your current code. Try the page yourself too.
Your feedback
Open your page on your computer
- Save the page using the link below. Put it in a new folder.
- Copy your chosen image into the same folder. Its name must match the filename in
src. - Double-click
index.htmlto open it in your browser. Check the image and links. - To edit it locally, open the file in a plain text editor or VS Code. Save your changes, then refresh the browser.
Can you see the image, and have you described it? Save the page and open it on your computer before starting your project.
Next: Project: your personal pageI need help
Choose the image first. Keep its filename in src and change the words in alt. If you change the filename to one that does not exist, the description appears instead of the image.
A downloaded page needs the original image beside it. Follow “Open your page on your computer” above.
The plain appearance is expected. HTML provides the content; you will style it in CSS.
Save the page to your computer
If the download does not start, copy the complete code below into a text file named index.html and save it as UTF-8.