In the image tag of HTML, which attribute specifies the path of the image file to be displayed?
- A.alt
- B.href
- C.src
- D.title
Show answer
Explanation
The correct answer is C, src. Short for source, it holds the path or URL of the image file that the browser must fetch and display, and without it the image element has nothing to show. A is wrong because alt gives alternative text, displayed in place of the picture if it cannot be loaded and read out by screen readers for visually impaired users; it is strongly recommended on every image but it does not locate the file. B is wrong because href is the attribute of the anchor and link elements, giving the address a link points to, and it is not used by the image tag at all. D is wrong because title supplies advisory text that most browsers show as a tooltip when the pointer rests on the element; it is optional and decorative. Remember that img is also an empty tag.