area type attribute
The type attribute on the area element:
- allows you to specify the media (MIME) type of the linked resource; information useful for user agents
- type is a specific attribute → can be applied ONLY on the next HTML5 elements: a, area, button, embed, input, link, menu, menuitem, object, ol, script, source, style
MIME types Examples for different resources:
- - image⁄png (for .png image format: image.png)
- image⁄gif (for .gif image format: image.gif)
- image⁄jpeg (for .jpeg image format: image.jpeg)
- image⁄pjpeg (for .jpeg image format in IE: image.jpeg)
- image⁄vnd.microsoft.icon (for .ico image format: favicon.ico)
- text⁄css (for .css file format: style.css)
- text⁄html (for .php file format: area1.php)
- text⁄javascript (for .js file format: script.js)
- audio⁄ogg (for .ogg audio file format: sound.ogg)
- audio⁄mp4 (for .mp4 audio file format: sound.mp4)
- video⁄ogg (for .ogg video file format: video.ogg)
- application⁄zip (for .zip file format: file.zip)
Warning: type attribute can be used only if href attribute is present on area element.
Examples
<area | attribute | = | "value(s)" | > | Examples | ||
---|---|---|---|---|---|---|---|
9. | type | = | MIME type | <href="area1.php" alt="area 1" type="text⁄html"> |
Video demonstration area type attribute
HTML5 area type attribute Tutorial
min | video details |
---|---|
00:00 | video tutorial: type attribute on area element |
00:08 | type attribute on area element allows you to specify the media type (MIME) for the linked resource |
00:13 | in our case, for our linked resource: css.php (.html format) |
00:13 | the MIME type is: text/html |
00:29 | no change in display, specifying the MIME type is useful for user agents |