HTML and CSS Certification Practice Test

Question: 1 / 400

Which attribute is used to specify the source of an image in HTML?

src

The attribute used to specify the source of an image in HTML is "src." This attribute is critical in the `<img>` tag, as it informs the browser where to fetch the image file that should be displayed on the webpage. Without the "src" attribute, the browser would not know which image to load, resulting in a broken image link or no image displayed at all.

The "href" attribute is primarily used in anchor tags (`<a>`) to define the target URL of a hyperlink, making it irrelevant for images. The "alt" attribute serves a different purpose; it provides alternative text for the image in case it cannot be displayed for some reason, such as slow loading or for accessibility purposes but does not indicate where the image is located. Lastly, "link" as a term is not a standard HTML attribute for images; instead, it is used in other contexts within HTML, such as linking stylesheets to a document. Therefore, "src" is indeed the correct and essential attribute for defining the source of an image in HTML.

Get further explanation with Examzify DeepDiveBeta

href

alt

link

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy