問題:
我一直在嘗試模仿範例中看到的手寫文字動畫效果[這個](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中文網其他相關文章!