HTMLtype 属性
<area> 元素的 type 属性设置目标 url 的 MIME(多用途互联网邮件扩展)类型。以下是语法 −
<area type="type_of_media">
上面,type_of_media 是链接文档的标准媒体类型,例如,image/bmp、image/tiff、image/tff 等。
现在我们来举一个例子来实现 <area> 元素的 type 属性 −
示例
<!DOCTYPE html> <html> <body> <h2>Learning</h2> <p>Learn these technologies with ease....</p> <img src = /images/usemap.gif alt = "usemap" border = "0" usemap = "#tutorials"/> <map name = "tutorials"> <area shape = "poly" coords = "74,0,113,29,98,72,52,72,38,27" href = "/perl/index.htm" alt = "Perl Tutorial" download="perl" hreflang="en"/> <area shape = "rect" coords = "22,83,126,125" alt = "HTML Tutorial" href = "/html/images/test.png" type="image/png" /> <area shape = "circle" coords = "73,168,32" alt = "PHP Tutorial" href = "/php/index.htm" target = "_blank" download="php" hreflang="en"/> </map> </body> </html>
输出
现在,当你点击 HTML 区域时,将看到以下 png 图像。我们已将媒体类型设置为 image/png −
广告