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…
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)- A4% (1)
- B88% (23)
- D8% (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
Community Discussion
No community discussion yet for this question.