大家好,我用svg画了一个圆圈。这个圆圈有一个悬停效果,我想在圆圈内添加一个链接,链接文本可以随着悬停效果一起改变颜色。请找到下面的代码,我感谢帮助。如何在svg圈内添加一个链接
HTML
<svg id="circle">
<circle cx="125" cy="125" r="100" stroke="darkblue" stroke-width="3" fill="green" />
</svg>
CSS
svg#circle {
height: 250px;
width: 250px;
}
circle {
stroke-dasharray: 700;
stroke-dashoffset: 700;
stroke-linecap: butt;
-webkit-transition: all 2s ease-out;
-moz-transition: all 2s ease-out;
-ms-transition: all 2s ease-out;
-o-transition: all 2s ease-out;
transition: all 2s ease-out;
}
circle:hover {
fill: pink;
stroke-dashoffset: 0;
stroke-dasharray: 700;
stroke-width: 10;
}
关于联的实际问题是很容易回答(如下),但是这个使用了动画中风破折号过渡是非常聪明的,值得赞赏:) – brichins