html部分:
<a id="a5" href="#" class="know_thiye">
<svg>
<rect x="0" y="0" fill="none" width="100%" height="100%"></rect>
</svg>
<span>MORE</span>
</a>
css部分:
.know_thiye {
display: block;
font-size: 0.22rem;
font-weight: 400;
text-align: center;
margin: 0.6rem 0;
width: 1.5rem;
height: 0.4rem;
position: relative;
transition: all 450ms linear 0s; // *过渡
color: #313944;
}
.know_thiye span {
line-height: 0.5rem;
}
.know_thiye svg {
height: 0.5rem;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
/* 动画部分 */
.know_thiye rect {
fill: none;
stroke: #078fdf;
stroke-width: 5;
stroke-dasharray: 422, 0;
transition: all 450ms linear 0s;
}
.know_thiye:hover rect {
stroke-width: 5;
stroke-dasharray: 22, 323;
stroke-dashoffset: 80;
transition: all 1s cubic-bezier(0.19, 1, 0.22, 1);
}
/* 动画部分 end */
.know_thiye:hover {
font-weight: 900;
letter-spacing: 1px;
}