coords

HTML coords Attribute (HTML COORDS属性)

The HTML coords attribute specifies the coordinates of an area in the image-map. To specify the shape, size, and placement of an area, it is used with the shape attribute. (HTML坐标属性指定图像映射中某个区域的坐标。要指定区域的形状、大小和位置,它与形状属性一起使用。)

You can use this attribute on the <area> element.

The top-left corner of an area has the 0,0 coordinates. (区域的左上角具有0,0坐标。)

The coords attribute can have the following values: (Coords属性可以具有以下值:)

  • x1, y1, x2, y2. It specifies a rectangle’s top-left (x1, y1) and bottom-right (x2, y2) corner coordinates. (- x1、y1、x2、y2。它指定矩形的左上角(x1, y1)和右下角(x2, y2)坐标。)

  • x, y, radius. It specifies a circle’s center coordinates (x, y) and radius (radius). (- x, y,半径。它指定圆的中心坐标( x, y )和半径(半径)。)

  • x1, y1, x2, y2, .., xn, yn. It specifies a polygon’s coordinates. (- x1、y1、x2、y2、..、xn、yn。它指定多边形的坐标。)

Syntax

Syntax (语法)

<area coords="value">

Example of the HTML coords Attribute:

<!DOCTYPE html>
<html>
 <head>
   <title>Title of the document</title>
 </head>
 <body>
   <p>Click on the logo or on one of the logo item to watch it closer:</p>
   <img src="/uploads/media/news_gallery/0001/01/thumb_316_news_gallery_list.jpeg"  width="250" height="150" alt="block" usemap="#blockmap">
   <map name="blockmap">
     <area shape="circle" coords="50,32,25" alt="html" href="/uploads/media/book_gallery/0001/01/d450f0358f947dffb3af91195c3002600d74101b.png">
     <area shape="circle" coords="218,115,25" alt="css" href="/uploads/media/book_gallery/0001/01/25521e981b34da57c8f51baddc5b76351b855818.png">
     <area shape="circle" coords="195,32,28" alt="php" href="/uploads/media/book_gallery/0001/01/4bbee6698c4884f25c46010d61b658dd62d2c04f.png">
     <area class="homepage" shape="rect" coords="90,90,35,55" alt="php" href="https://www.w3cdoc.com/">
   </map>
 </body>
</html>


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部