Use of href, hreflang attribute of area tag in HTML5.
Use of href, hreflang attribute of area tag in HTML5.In this tutorial we will discuss the implementation and use of href, hreflang attributes of the <area> tag in html5.
href:The syntax for both the attributes are:
<area href="URL" hreflang="value" /> |
The attribute value refers to the language code, which is two letter code for specifying the language of the linked document. e.g. en for English, hi for Hindi etc.
There is no difference between html4.0 and html5 href, hreflang attribute.
The example for these attribute implementations are as follow:
href_attribute_of_area_tag.html
<!DOCTYPE html > <html> <head> <title> Example For Area Tag href attribute </title> </head> <body> <img src="comp.gif" width="350" height="299" usemap="#computermap" /> <map name="computermap"> <area coords="16, 78, 123, 242" href="hreflang.html" shape="rect" hreflang="en" /> <area coords="138, 90, 303, 239" href="hreflang.html" shape="rect" hreflang="en"/> <area coords="70, 244, 324, 290" href="hreflang.html" shape="rect" hreflang="en"/> </map> </body> </html> |
Output.
We can see the output by clicking on the image given below.
Note: See the browser compatible page for successfully rendering the program.