HTML Basics
Adding images

You can add images to your websites to make them look fancy.

We use an image tag, like so: <img>. This tag is a bit different from the others. Instead of putting the content between the tags, you tell the tag where to get the picture using src. It's also different because there is no ending tag. It has / in the tag to close it: <img src="url" />.

Check out the tag to the right—it adds a picture of a rubber duck to the page! (You can see it by clicking on the Preview button.)

See the web address (or URL) after src=? It's "http://s3.amazonaws.com/codecademy-blog/assets/f3a16fb6.jpg". That tells the <img> tag where to get the picture from!

Every image on the web has its own image URL. Simply right-click on an image and choose "Copy image URL." Paste that URL in quotes after src= to insert with your <img> tag.


Add a second image below the first one. (Make sure it's before the closing <body> tag!)

If you can't think of a good picture, use this ninja:

View Preview