svg-element-demo

svg-element-demo

by hangyangws

HTML

<svg width="600" height="250" version="1.1" xmlns="http://www.w3.org/2000/svg">
  <!--矩形-->
  <rect
    x="10" y="10"
    fill="transparent"
    width="30" height="60"
    stroke-width="10" stroke="#9B7B56"
  />
  <!--圆角矩形-->
  <rect
    x="60" y="10"
    rx="10" ry="10"
    width="60" height="40"
    fill="transparent"
    stroke="#FF9090" stroke-width="5"
  />
  <!--圆形-->
  <circle
    fill="#C3413D"
    cx="180" cy="50" r="40"
    stroke="green" stroke-width="5"
  />
  <!--椭圆-->
  <ellipse
    fill="transparent"
    cx="320" cy="28" rx="80" ry="20"
    stroke="#FFC302" stroke-width="5"
  />
  <!--直线-->
  <line
    x1="10" x2="50"
    y1="110" y2="150"
    fill="transparent"
    stroke="orange" stroke-width="5"
  />
  <!--折线-->
  <polyline
    points="60 110 65 120 70115 75 130 80 125 85140 90 135 95 150 100 145"
    stroke="#9B7B56" stroke-width="5"
    fill="transparent"
  />
  <!--多边形-->
  <polygon
    points="50 160 55 180 70180 60 190 65 205 50195 35 205 40 190 30 180 45 180"
    stroke="#FFC302" stroke-width="5"
    fill="transparent"
  />
  <!--路径 -->
  <path
    d="M20,230 Q40,205 50,230 T90,230"
    stroke="#9B7B56" stroke-width="5"
    fill="none"
  />
</svg>