鍍金池/ 教程/ HTML/ SVG鏈接
SVG鏈接
SVG陰影效果
SVG線性漸變
SVG文本
SVG平面陰影
SVG圖表
SVG交互
SVG時鐘
SVG漸變
SVG <pattern>元素
SVG簡介
SVG徑向漸變
SVG <filter>元素
SVG對話框效果
SVG形狀
SVG stroke屬性
SVG圖形
SVG教程
SVG事件監(jiān)聽器
SVG加載器示例
SVG腳本(JavaScript)
SVG圖標
SVG拖動
SVG模糊效果

SVG鏈接

<a>元素用于創(chuàng)建超鏈接。 xlink:href屬性用于傳遞與URI(統(tǒng)一資源標識符)互補的IRI(國際化資源標識符)。

聲明

以下是<a>元素的語法聲明。 我們只顯示了一些主要的屬性。

<a
   xlink:show = "new" | "replace"
   xlink:actuate = "onRequest"
   xlink:href = "<IRI>"
   target = "_replace" | "_self" | "_parent" | "_top" | "_blank" | "<XML-Name>" >
</a>

屬性

編號 名稱 描述
1 xlink:show 用于XLink識別處理器的文檔目的。 默認是new。
2 xlink:actuate 用于XLink識別處理器的文檔目的。
3 xlink:href 被引用對象的位置。
4 target 當結束資源的時候使用。

示例

文件:testSVG.html -

<html>
   <title>SVG Linking</title>
   <body>

      <h1>Sample Link</h1>

      <svg width="800" height="800">
         <g>
            <a xlink:href="http://www.yiibai.com"> 
               <text x="0" y="15" fill="black" >
               Click me to load Yiibai DOT COM.</text>
            </a>
         </g> 

         <g>
            <text x="0" y="65" fill="black" >
            Click in the rectangle to load Yiibai DOT COM</text>

            <a xlink:href="http://www.yiibai.com"> 
               <rect x="100" y="80" width="300" height="100"
               style="fill:rgb(121,0,121);stroke-width:3;stroke:rgb(0,0,0)" /> 
            </a>
         </g>
      </svg>

   </body>
</html>

在Chrome瀏覽器中打開:textSVG.html 文件。