What is the correct HTML for inserting an image?
-
<img display="image.gif" />
-
<img image="image.gif" />
-
<img src="image.gif" />
-
<img ="image.gif" />
Reveal answer
Fill a bubble to check yourself
C
Correct answer
Explanation
HTML images use the self-closing tag with a 'src' attribute pointing to the image file path:
. 'display', 'image', and bare '=' are not valid image attributes.
AI explanation
The correct HTML for embedding an image uses the src (source) attribute: <img src="image.gif">. src tells the browser where to fetch the image file from — it's the only attribute the <img> element recognizes for the image location. 'display', 'image', and a bare = are not valid HTML attributes on <img>, so none of those would load an image; they'd simply be ignored or cause invalid markup.