<polygon> 标签

<polygon> 标签用来创建含有不少于三个边的图形。

请把下面的代码拷贝到记事本,然后把文件保存为 "polygon1.svg"。把此文件放入您的 web 目录:

<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <polygon points="220,100 300,210 170,250" style="fill:#cccccc; stroke:#000000;stroke-width:1"/> </svg>

代码解释:

points 属性定义多边形每个角的 x 和 y 坐标

效果图:

(8)SVG中所用到的形状简介------不少于三个边的图形

下面的例子创建一个四边形:

<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <polygon points="220,100 300,210 170,250 123,234" style="fill:#cccccc; stroke:#000000;stroke-width:1"/> </svg>

效果图:

(8)SVG中所用到的形状简介------不少于三个边的图形

相关文章:

  • 2021-09-08
  • 2021-09-17
  • 2022-12-23
  • 2021-07-25
  • 2022-02-14
  • 2021-08-10
  • 2021-06-21
  • 2022-02-22
猜你喜欢
  • 2021-06-19
  • 2022-01-24
  • 2021-09-28
  • 2021-08-18
  • 2022-01-18
  • 2022-12-23
  • 2021-05-14
相关资源
相似解决方案