html5使用svg步驟

  1. 創建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">
    <circle cx="100" cy="50" r="40" stroke="black"
    stroke-width="2" fill="red"/>
    </svg>
  2. 在html中引入svg:
    1、方式一:
    <object data="test.svg" 
    type="image/svg+xml"
    codebase="http://www.adobe.com/svg/viewer/install/"/>
    2、方式二:
    <embed src="test.svg"
    type="image/svg+xml"
    pluginspage="http://www.adobe.com/svg/viewer/install/" />
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章