4.8.12 The map element
4.8.12 The map element
Категории:
потоковое содержимое.
Фразовое содержимое.
Palpable content.
Контексты, в которых может использоваться этот элемент:
Где ожидается Фразовое содержимое.
Контентная модель:
Transparent.
Опущение тегов в text/html:
Ни один из тегов не может быть опущен.
Атрибуты контента:
глобальные атрибуты
name — Name of image map to reference from the usemap attribute
Специфика доступности:
Для авторов.
Для разработчиков.
Санитизация:
Uncategorized.
DOM-интерфейс:
[Exposed=Window]
interface HTMLMapElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, Reflect] attribute DOMString name;
[SameObject] readonly attribute HTMLCollection areas;
};
The map element, in conjunction with an img element and any area element descendants, defines an image map. The element represents its children.
The name attribute gives the map a name so that it can be referenced. The attribute must be present and must have a non-empty value with no ASCII whitespace. The value of the name attribute must not be equal to the value of the name attribute of another map element in the same tree. If the id attribute is also specified, both attributes must have the same value.
map.areas
Returns an HTMLCollection of the area elements in the map.
The areas attribute must return an HTMLCollection rooted at the map element, whose filter matches only area elements.
Image maps can be defined in conjunction with other content on the page, to ease maintenance. This example is of a page with an image map at the top of the page and a corresponding set of text links at the bottom.
<!DOCTYPE HTML>
<HTML LANG="EN">
<TITLE>Babies™: Toys</TITLE>
<HEADER>
<H1>Toys</H1>
<IMG SRC="/images/menu.gif"
ALT="Babies™ navigation menu. Select a department to go to its page."
USEMAP="#NAV">
</HEADER>
...
<FOOTER>
<MAP NAME="NAV">
<P>
<A HREF="/clothes/">Clothes</A>
<AREA ALT="Clothes" COORDS="0,0,100,50" HREF="/clothes/"> |
<A HREF="/toys/">Toys</A>
<AREA ALT="Toys" COORDS="100,0,200,50" HREF="/toys/"> |
<A HREF="/food/">Food</A>
<AREA ALT="Food" COORDS="200,0,300,50" HREF="/food/"> |
<A HREF="/books/">Books</A>
<AREA ALT="Books" COORDS="300,0,400,50" HREF="/books/">
</P>
</MAP>
</FOOTER>