1D0-61B practice question 12 of 15
You are modifying an existing Web page that needs to validate as HTML5 code. To create a rectangular hot-spot in an image map that links to www.xyz.com, which code would you nest inside the <map> </map> container tags?
Full set: 55 questionsTo create a valid HTML5 rectangular hot-spot, the element must be used. The shape attribute's correct value for a rectangle is rect. The href attribute requires a full, absolute URL, including the protocol (e.g., http://), to link to an external site, and its value must be quoted. Crucially, for accessibility and HTML5 validation, the alt attribute is mandatory when the href attribute is present. Option C is the only choice that meets all these requirements: correct shape value, properly formatted URL, and inclusion of the required alt attribute.
A. The value for the shape attribute is incorrect. The standard value for a rectangle is rect, not rectangle, for HTML5 validation.
B. The shape attribute value is incorrect (rectangle instead of rect), and the href value is a relative path, not a full URL needed for an external link.
D. This option is missing the alt attribute, which is a mandatory attribute for the element when an href attribute is specified.
1. WHATWG HTML Living Standard: In the section on the element, the shape attribute is defined. It states, "The shape attribute, if specified, must have a value that is a case-insensitive match for one of 'circle', 'default', 'poly', or 'rect'." This confirms rect is the correct value.
Source: WHATWG HTML Living Standard, Section 4.8.15 The area element. (https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-shape)
2. WHATWG HTML Living Standard: The same section specifies the requirement for the alt attribute: "The alt attribute must be specified if the href attribute is present." This invalidates option D.
Source: WHATWG HTML Living Standard, Section 4.8.15 The area element. (https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-alt)
3. W3C HTML 5.2 Recommendation: This official specification also defines the valid keywords for the shape attribute, listing rect as the conforming value for a rectangle. It also states that the alt attribute is required on elements that have an href attribute.
Source: W3C HTML 5.2 Recommendation, Section 4.8.15 The area element. (https://www.w3.org/TR/html52/imagemap.html#the-area-element)
4. MDN Web Docs (Mozilla): While a developer resource, it is widely used in academic settings and reflects official standards. The page for confirms: "shape: The shape of the associated hot spot. The specifications for...HTML5 define the values rect, circle, poly, and default." and "alt: ...It is a required attribute for the element."
Source: MDN Web Docs, : The Image Map Area element. (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area)
Keep practicing
Take the free 1D0-61B practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1D0-61B practice questions
- Question 1Which choice describes a correct order of precedence for implementing CSS?
- Question 2Which choice lists the HTML5 elements that define the document structure for a Web page?
- Question 3Which Web-based validation tool is used to validate Cascading Style Sheets (CSS)?
- Question 4You have been asked to design and develop a Web site for a retirement community. What can…
- Question 5Which line of code instructs the browser to look for a directory named mysite that begins…
- Question 6You need to center and indent a quote on your Web page. Which is the best way to accompli…
