20160209 SVG


SVG ( 可缩放矢量图形 Scalable Vector Graphics ) 是基于 XML ( 可扩展的标识语言 Extensible Markup Language ) 支持交互和动画的二维图像格式。
SVG 在 XML 中被定义。

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <rect x="25" y="25" width="200" height="200" fill="lime" stroke-width="4" stroke="pink" />
  <circle cx="125" cy="125" r="75" fill="orange" />
  <polyline points="50,150 50,200 200,200 200,100" stroke="red" stroke-width="4" fill="none" />
  <line x1="50" y1="50" x2="200" y2="200" stroke="blue" stroke-width="4" />

用 circle 时 The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are omitted, the circle’s center is set to (0, 0),cx 和 cy 定义了圆心的坐标,默认为 (0, 0)

Since SVG is written in XML, all elements must be properly closed!