HTML <area> href attribute

Paglilinaw at paggamit

href Ang attribute ay nagbibigay ng target na link ng lugar.

Kung href Kung ang attribute ay wala, ang <area> tag ay hindi hyperlink.

Mga halimbawa

Ginagamit ang href attribute upang magbigay ng target na link sa bawat lugar ng image mapping:

<map name="planetmap">
<area shape="rect" coords="0,0,114,576" href="sun.html" alt="Sun">
<area shape="circle" coords="190,230,5" href="mercur.html" alt="Mercury">
<area shape="circle" coords="228,230,5" href="venus.html" alt="Venus">
</map>

Subukan nang personal

Mga sintaksis

<area href="URL">

Halaga ng attribute

Halaga Paglalarawan
URL

Tinutukoy ang layunin ng hyperlink sa lugar.

Mga posibleng halaga:

  • Absolute URL - Tumututok sa ibang website (halimbawa href="http://www.example.com/sun.html")
  • Relative URL - Tumututok sa file sa loob ng website (halimbawa href="sun.html")
  • Link sa elemento na may tinukoy na id sa pahina (halimbawa href="#top")
  • Ilang iba pang protocol (halimbawa https://, ftp://, mailto:, file: at iba pa)
  • Script (halimbawa href="javascript:alert('Hello');")

Suporta ng browser

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Suporta Suporta Suporta Suporta Suporta