?
What is the correct HTML code for inserting an image ?
What is the correct HTML code for inserting an image ?
1. <img>image.gif</img>
2. <img href=”image.gif/>
3. <img src=”image.gif”>
Answer & Solution
Correct Answer:
Option
C
The correct HTML code for inserting an image uses the
tag with the src attribute to specify the image source.
Option 1: <img>image.gif</img> - This is incorrect. The
tag is self-closing and does not use a closing tag.
Option 2: <img href=”image.gif”/> - This is incorrect. The href attribute is used for links, not images.
Option 3: <img src=”image.gif”> - This is the correct answer. The src attribute specifies the path to the image.
Option D: None of the above - This is incorrect because Option 3 correctly lists the HTML code for inserting an image.
Option 1: <img>image.gif</img> - This is incorrect. The
Option 2: <img href=”image.gif”/> - This is incorrect. The href attribute is used for links, not images.
Option 3: <img src=”image.gif”> - This is the correct answer. The src attribute specifies the path to the image.
Option D: None of the above - This is incorrect because Option 3 correctly lists the HTML code for inserting an image.
Join the Discussion
Login to post a comment or share your explanation.
Logina. a.blue, a.green{display:block;}
b. a:blue{display:block;}