Lesson 8

Images

Why do we use images?

Welcome to my art gallery! Imagine if all these pictures were missing! It would be a pretty sad place to be. I put them all up using image tags.

What attributes does an image need? 

An image tag needs two attributes: src and alt.

Src stands for source. This attribute will tell the computer where the image link is saved. Usually this link is relative, but sometimes it’s absolute.

Alt stands for alternate text. This is a description of your image. Every image tag needs alternative text because if your image doesn’t load for some reason, the visitor still needs to know what it’s a picture of. Some people who can’t see also use websites with tools called screen readers, and alt text helps them know what’s in the picture even if they can’t see it when it loads.

Are you ready to learn?

It’s time to create your own gallery! Here are six relative image links. 1. Add your favorite three images to the HTML box using the <img> tag

2. Add an alt description to each one.

../wp-content/uploads/2022/03/8-art-1.png
../wp-content/uploads/2022/03/8-art-2.png
../wp-content/uploads/2022/03/8-art-3.png
../wp-content/uploads/2022/03/8-art-6.png
../wp-content/uploads/2022/03/8-art-5.png
../wp-content/uploads/2022/03/8-art-4.png

Build with us!

HTML

CSS

JavaScript

Output