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:
Instructions
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:
To create an image that is 150px wide and with <span classname='highlighted-code'>https://courses.code-hl.com/logo.png
</span> as the url, write the following:
<img src="https://courses.code-hl.com/logo.png" width="150" />
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:
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:
Sign up to start coding
Already have an account?
Sign In