问题:
我一直在尝试模仿示例中看到的手写文本动画效果[这个](http://codepen.io/se7ensky/pen/waoMyx)和[这个](https://codepen.io/munkholm/pen/EaZJQE)。但是,我只能为笔画设置动画,而不能为整个文本设置动画。
代码:
.test { width: 300px /* margin:0 auto; */ } .l1 { animation: dash 15s 1; stroke-linecap: round; stroke-miterlimit: 10; stroke-dasharray: 300; stroke-dashoffset: 300; animation-fill-mode: forwards; /*fill: none;*/ } .l2 { stroke-dasharray: 300; stroke-dashoffset: 300; animation: dash 20s linear forwards; -webkit-animation-delay: 1s; /* Chrome, Safari, Opera */ animation-delay: 1s; } .l3 { stroke-dasharray: 300; stroke-dashoffset: 300; animation: dash 25s linear forwards; -webkit-animation-delay: 2.5s; /* Chrome, Safari, Opera */ animation-delay: 2.5s; } .l4 { stroke-dasharray: 300; stroke-dashoffset: 300; animation: dash 25s linear forwards; -webkit-animation-delay: 4.5s; /* Chrome, Safari, Opera */ animation-delay: 4.5s; } @keyframes dash { to { stroke-dashoffset: 0; } }
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 19.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg class="test" version="1.1">
以上是如何使用 SVG 在网页上制作手写文本动画?的详细内容。更多信息请关注PHP中文网其他相关文章!