特性:
可以添加到任意的图形上
xlink:href
:指定连接地址xlink:title
:指定连接提示target
:指定打开目标
案例
svg <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>
07-15
07-15
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交