YouTip LogoYouTip

Att A Coords

# HTML `` `coords` Attribute The `coords` attribute of the `` (anchor) tag is a legacy HTML attribute used to define the coordinates of a clickable region within an image map. It is used in conjunction with the `shape` attribute to specify the size, shape, and position of a link on an `` or `` element. --- ## Overview and Usage Historically, the `coords` attribute allowed developers to turn an anchor tag into an interactive hotspot on an image map. The coordinate system begins at `0,0`, which represents the top-left corner of the image. > ⚠️ **Important Deprecation Notice:** > The `coords` attribute on the `` tag is **deprecated and obsolete in HTML5**. Modern web standards do not support this attribute on anchor tags. To create cross-browser compatible, standard-compliant image maps, you should use the `` and `` elements instead. --- ## Syntax ```html Link Text ``` --- ## Attribute Values The format of the `coords` value depends entirely on the value of the accompanying `shape` attribute: | Shape | `coords` Format | Description | | :--- | :--- | :--- | | **`rect`** (Rectangle) | `x1,y1,x2,y2` | Specifies the coordinates of the top-left corner (`x1,y1`) and the bottom-right corner (`x2,y2`) of the rectangle. | | **`circle`** (or `circ`) | `x,y,radius` | Specifies the coordinates of the circle's center (`x,y`) and its `radius` in pixels. | | **`poly`** (Polygon) | `x1,y1,x2,y2,..,xn,yn` | Specifies the coordinates for each vertex of the polygon. If the first and last coordinates do not match, the browser will automatically close the polygon by connecting the last point to the first. | --- ## Code Example The following example demonstrates how the `shape` and `coords` attributes were historically used inside an `` element to create an interactive image map of the solar system: ```html Sun Mercury Venus ``` --- ## Browser Support The `coords` attribute on the `` tag has very limited and inconsistent browser support in modern environments: * **Supported by:** Older versions of Firefox and Opera. * **Not supported by:** Google Chrome, Safari, Internet Explorer, and Microsoft Edge. Because of this extremely limited support, **do not use this attribute in production environments**. --- ## Modern Alternative: The `` Element To create fully compatible, modern image maps that work across all browsers, use the `` tag inside a `` element instead of applying `coords` to the `` tag. ### Modern Best-Practice Example: ```html Planets Sun Mercury Venus ```
← Att A DownloadAtt A Charset β†’

YouTip © 2024-2026 | Home | Learn Technology, Build Dreams!

All content is for educational and learning purposes only.