map, area

설명
이미지 내에 영역 설정해서 링크 연동
Primary
Primary
content category
embedded
flow
 
  1. imgusemap="#이름" 으로 지정하고
    1. <img src="https://~~~" alt="진실 혹은 거짓" usemap="#vending" style="width:320px; height:240px">
  1. map tag에 이름을 써서 연동
    1. <map name="vending"> <area shape="rect" coords="210,200,70,130" alt="진실" href="https://~~~"> <area shape="rect" coords="90,60,180,130" alt="거짓" href="https://~~~~"> </map>
 

예시 코드

저기 각각 위치마다 연동된 링크가 다르다.
notion image
<map name="infographic"> <area shape="rect" coords="184,6,253,27" href="https://mozilla.org" target="_blank" alt="Mozilla" /> <area shape="circle" coords="130,136,60" href="https://developer.mozilla.org/" target="_blank" alt="MDN" /> <area shape="poly" coords="130,6,253,96,223,106,130,39" href="https://developer.mozilla.org/docs/Web/Guide/Graphics" target="_blank" alt="Graphics" /> <area shape="poly" coords="253,96,207,241,189,217,223,103" href="https://developer.mozilla.org/docs/Web/HTML" target="_blank" alt="HTML" /> <area shape="poly" coords="207,241,54,241,72,217,189,217" href="https://developer.mozilla.org/docs/Web/JavaScript" target="_blank" alt="JavaScript" /> <area shape="poly" coords="54,241,6,97,36,107,72,217" href="https://developer.mozilla.org/docs/Web/API" target="_blank" alt="Web APIs" /> <area shape="poly" coords="6,97,130,6,130,39,36,107" href="https://developer.mozilla.org/docs/Web/CSS" target="_blank" alt="CSS" /> </map> <img usemap="#infographic" src="/media/examples/mdn-info.png" alt="MDN infographic" />
 
속성