Images & Media
shape="rect"
Defines a rectangular region with four coordinates: left x, top y, right x, bottom y. Use CSS pixel coordinates relative to the image and keep them synchronized if the displayed geometry changes. On area within map; missing or invalid defaults to rect. Geometry must match the actual image. Use alt for linked areas.
Formal Syntax & Structure
html syntaxhtml
shape="rect"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| shape | keyword | Defines a rectangular region with four coordinates: left x, top y, right x, bottom y. Use CSS pixel coordinates relative to the image and keep them synchronized if the displayed geometry changes. |
| coords | coordinate list | Four numbers: left, top, right, bottom. |
Working Example
Example Snippethtml
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNjAiIGhlaWdodD0iMTAwIj48cmVjdCB3aWR0aD0iMTYwIiBoZWlnaHQ9IjEwMCIgZmlsbD0ibGlnaHRibHVlIi8+PGNpcmNsZSBjeD0iODAiIGN5PSI1MCIgcj0iMzAiIGZpbGw9Im5hdnkiLz48L3N2Zz4=" width="160" height="100" alt="Diagram with a linked region" usemap="#diagram"><map name="diagram"> <area shape="rect" coords="0,0,40,40" href="#details" alt="Region details"></map><p id="details">Region details</p>