SVG 使用方法

 
SVG 使用方法
 

   SVG 既 XML Format
 
   <?xml version="1.0"?>
 
   <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
 
   <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="467" height="462">
 
      <rect x="80" y="60" width="250" height="250" rx="20" fill="red"
      stroke="black" stroke-width="2px" />
 
      <rect x="140" y="120" width="250" height="250" rx="40" fill="blue"
      stroke="black" stroke-width="2px" fill-opacity="0.7" />
 
   </svg>
 

 
SVG 既 XML Format 內容 可以直接插係 HTML 內
 
其他 Sample : w3schools.com
 
註: 部分功能被 HTML5 Canvas 取代 ( 純屬個人意見 )