-
特性:
-
可以添加到任意的图形上
-
xlink:href
:指定连接地址 -
xlink:title
:指定连接提示 -
target
:指定打开目标
-
-
案例
<svg xmlns="http://www.w3.org/2000/svg" width="600" height="400"> <defs> <!-- 网格 --> <pattern id="grid" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"> <path fill="none" stroke="#f1f1f1" d="M 0 0 H 20 V 20"/> </pattern> </defs> <!-- 绘制网格 --> <rect width="600" height="400" fill="url(#grid)"/> <!-- 超链接 --> <a xlink:href="https://www.baidu.com" xlink:title="跳转百度" target="_blank"> <text x="50" y="50">百度</text> </a> <a xlink:href="https://www.baidu.com" xlink:title="跳转百度" target="_blank"> <rect x="50" y="100" width="100" height="100" fill="red"/> <text x="60" y="150" fill="green">点击正方形</text> </a> </svg>
SVG 超链接 <a>
最新推荐文章于 2022-11-07 21:30:31 发布