HTML CSS examples for HTML Tag:area
The href attribute specifies the hyperlink target for the area.
Value | Description |
---|---|
URL | Specifies the hyperlink target for the area. |
Possible values:
Item | Example |
---|---|
An absolute URL - points to another web site | href="http://www.example.com/") |
A relative URL - points to a file within a web site | href="a.htm" |
Link to an element with a specified id within the page | href="#top") |
Other protocols | https://, ftp://, mailto:, file:, etc.. |
A script | href="javascript:console.log('Hello'); |
An image-map, with clickable areas:
<!DOCTYPE html> <html> <body> <img src="https://www.java2s.com/style/demo/Opera.png" width="145" height="126" alt="message" usemap="#myMap"> <map name="myMap"> <area shape="rect" coords="0,0,80,100" alt="S" href="http://java2s.com"> <area shape="circle" coords="90,60,5" alt="M" href="http://java2s.com"> <area shape="circle" coords="130,60,10" alt="V" href="http://java2s.com"> </map><!--from w w w . ja va 2 s. c o m--> </body> </html>