From the course: HTML and CSS: Linking

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using images as links

Using images as links

- [Instructor] Images may also serve as a clickable link in your website. If you're going to make an image into a link, you should also include where that link goes in your alt tag for accessibility purposes. So I'm looking at my links.html document, it's inside of the begin folder inside of 01-08 in your EXERCISE FILES. And if you scroll down to line number 25, you'll see here that I have an img tag. It has a source of oliveoil.jpg. And I have an alt tag in here that says, "Olive oil bottles. "Click to visit Two Trees Olive Oil." In other words, if somebody looking at this website clicks this image, I'm telling them where they're going to go. Remember that an image can indeed be clickable for a link, but if someone is using a screen reader to click an image, they don't see the image, they have no idea where they're going. So you need to make sure that you include that inside of your alt tag. But turning this into a link is relatively straightforward. All we're going to need to do is…

Contents