New! My 44-page ebook "CSS in 44 minutes" is out! 😃
# area
Defines an interactive area within a map
.
Example: Copy
title
Defines the title of the area.
"North America"
The title will appear when hovering the area.
shape
Defines the shape of the area.
"rect"
The shape is a rectangle and requires 4 coordinates.
"circle"
The shape is a circle and requires 2 coordinates and 1 radius.
"polygon"
The shape is a polygon with unlimited points.
coords
Defines the coordinates related to the shape.
"116,104,234,154"
A rect
requires two pairs x1,y1,x2,y2
, where the first one defines the top left corner, and the second one the bottom right corner.
"50,80,20"
A circle
requires a pair and a radius x,y,r
. The pair defines the center of the circle.
"198,374,243,303,428,387,361,624,296,624"
A polygon
requires a collection of x,y
pairs.
href
Defines the target of the area.
"https://htmlreference.io"
You can pass an absolute URL.
"/element/div"
You can pass a URL relative to the root domain.
"#footer"
You can target an element within the same page. Here, we target the element <div id="footer">
"mailto:[email protected]"
You can use the mailto
protocol. Clicking the area will open the user's email client.
target
Defines in which tab or window the clicked area will show up.
"_blank"
Opens in a new browsing context, which is usually a new tab.
"_self"
Opens in the current tab.
"_parent"
Opens in the parent browsing context, or _self
is there is none.
"_top"
Opens in the top browsing context, or _self
is there is none.