HTML <영역> 태그
예시
클릭 가능한 영역이 있는 이미지 맵:
<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400"
height="379">
<map name="workmap">
<area shape="rect"
coords="34,44,270,350" alt="Computer" href="computer.htm">
<area
shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area
shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">
</map>
아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.
정의 및 사용
태그는 이미지 맵 내부 의 <area>
영역을 정의합니다(이미지 맵은 클릭 가능한 영역이 있는 이미지입니다).
<area>
요소는 항상
<map>
태그 내부에 중첩됩니다.
참고: 의 usemap
속성 은 요소의 속성 <img>
과 연결되어 있으며 이미지와 지도 간의 관계를 생성합니다.<map>
name
브라우저 지원
Element | |||||
---|---|---|---|---|---|
<area> | Yes | Yes | Yes | Yes | Yes |
속성
Attribute | Value | Description |
---|---|---|
alt | text | Specifies an alternate text for the area. Required if the href attribute is present |
coords | coordinates | Specifies the coordinates of the area |
download | filename | Specifies that the target will be downloaded when a user clicks on the hyperlink |
href | URL | Specifies the hyperlink target for the area |
hreflang | language_code | Specifies the language of the target URL |
media | media query | Specifies what media/device the target URL is optimized for |
referrerpolicy | no-referrer no-referrer-when-downgrade origin origin-when-cross-origin same-origin strict-origin-when-cross-origin unsafe-url |
Specifies which referrer information to send with the link |
rel | alternate author bookmark help license next nofollow noreferrer prefetch prev search tag |
Specifies the relationship between the current document and the target URL |
shape |
default rect circle poly |
Specifies the shape of the area |
target | _blank _parent _self _top framename |
Specifies where to open the target URL |
type | media_type | Specifies the media type of the target URL |
전역 속성
<area>
태그는 HTML의 전역 속성도 지원 합니다 .
이벤트 속성
<area>
태그는 HTML의 이벤트 속성 도 지원합니다 .
더 많은 예
예시
클릭 가능한 영역이 있는 또 다른 이미지 맵:
<img src="planets.gif"
width="145" height="126"
alt="Planets"
usemap="#planetmap">
<map
name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
관련 페이지
HTML DOM 참조: 영역 개체
기본 CSS 설정
대부분의 브라우저는 <area>
다음 기본값으로 요소를 표시합니다.
area {
display: none;
}