Code Highlights logo

Learn

HTML images

HTML images

Images are an essential part of web pages, adding visual appeal and enhancing the user experience.

In order to add an image you just need to have <img> tag.

The two attributes that it needs are:

  • src - short for source, specifies the URL or file path of the image
  • alt - short for alternative text, specifies the alternative text for the image

Here is an example:

1<img src="https://courses.code-hl.com/logo.png" alt="Codehighlights logo" />

Instructions

1.

Inside our ordered list, in the first item, right below the heading that says Greece, let's add an image that is 300px wide with the following url:

1https://cdn.cnn.com/cnnnext/dam/assets/170606121206-italy---travel-destination---shutterstock-517522957.jpg
2.

In our second list item, right below the heading that says Italy, let's add an image that is 300px wide with the following url:

1https://cdn.britannica.com/82/195482-050-2373E635/Amalfi-Italy.jpg
3.

In the third list item, right below the heading that says Spain, let's add an image that is 300px wide with the following url:

1https://www.state.gov/wp-content/uploads/2018/11/Spain-2109x1406.jpg

Sign up to start coding

Already have an account?

Sign In

Course content