Add Images to an HTML document

Taylor Bell
InstructorTaylor Bell

Social Share Links

Tweet

Images make a great addition to a web page. In this lesson, we will use the <img> tag to add an image to our page.

Instructor: [00:00] Let's add an image, so we'll do an img. This is going to be the first time that we use an attribute. We're going to use the source attribute, src. Then we'll do an equals sign and two quotes. Within our quotes we're going to be giving the address of the image. I'm pasting in the address of a picture of a burrito.

[00:18] Let's add a second-level heading that says "burrito." Below the image, I'm going to add a paragraph giving credit for this burrito picture. Another important attribute of images is the alt attribute. This is text that's used to describe the image in case it can't load. If the image can't load, there's nothing there to indicate that there should be a picture there.

[00:37] The alt tab will let me write "basic burrito." We can now see that we have a broken image where our burrito should be. Putting our address back, our burrito is back as well.