SVG路径描边动画与姓名笔画实例页面

回到相关文章 »

代码:

CSS代码:
path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  -webkit-animation: dash 5s linear infinite;
  animation: dash 5s linear infinite;
}

@-webkit-keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}
                
HTML代码:
<svg width="700" height="350" xmlns="http://www.w3.org/2000/svg">
    <g>
        <path d="...">
        <path d="...">
        <path d="...">
    </g>
</svg>
                

效果:

Layer 1