What is the correct HTML code for inserting an image?
Explanation
In HTML, images are defined with the <img> tag.
The src attribute defines the URL (web address) of the image:

<a href="https://quizful.com/">
<img src="https://quizful.com/app/assets/images/quizful-small.png"
alt="quizful-logo" width="100" height="100">
</a>

Click QUIZFUL LOGO !

quizful-logo

The <img> tag defines an image in an HTML page.
The <img> tag has two required attributes: src (web address of the image) and alt (alternatine text which is shown to a user when image can not be loaded because of different issues).
Note:
images are not technically inserted into an HTML page, images are linked to HTML pages.
The <img> tag reserves a space for the linked image.
Tip:
to link an image to another document, simply nest the <img> tag inside <a> tags.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
HTML & CSS quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes