nerdexam
CIW

1D0-61B · Question #51

To insert a graphic in a Web page and successfully validate the page as HTNL5, the <img> element must include:

The correct answer is B. The altattribute. In HTML5, the alt attribute is required on all <img> elements for the page to pass validation - it provides alternative text for screen readers and displays when an image fails to load, making it essential for both accessibility and standards compliance. The id attribute (A) is…

HTML5 Coding

Question

To insert a graphic in a Web page and successfully validate the page as HTNL5, the <img> element must include:

Options

  • ATheidattribute
  • BThe altattribute
  • CThe target attribute
  • DThe name attribute

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    88% (23)
  • D
    8% (2)

Explanation

In HTML5, the alt attribute is required on all <img> elements for the page to pass validation - it provides alternative text for screen readers and displays when an image fails to load, making it essential for both accessibility and standards compliance.

The id attribute (A) is optional and simply provides a unique identifier for styling or scripting purposes. The target attribute (C) belongs to anchor (<a>) and form elements, not images - it has no valid role on <img>. The name attribute (D) is a legacy attribute largely replaced by id and is not required or meaningful on image elements in HTML5.

Memory tip: Think "alt = always" - if you're validating HTML5, alt is the one attribute on <img> you can never skip.

Topics

#HTML5 validation#img element#alt attribute#accessibility

Community Discussion

No community discussion yet for this question.

Full 1D0-61B Practice