SVG基础|SVG TEXTPATH 元素

PHP中文网
Release: 2017-03-30 16:02:36
Original
2437 people have browsed it

SVG 元素用于将一串文本放置到一条指定的路径上。例如可以将文本串放置到一个圆上,做出非常酷的效果。对于不同的浏览器,路径文字的效果也略有不同。下面是一个简单的路径文字的例子:

      Text along a curved path...   
Copy after login

  下面是上面代码的返回结果:
880.png

  元素中的路径有一个ID属性。这个ID属性被元素的xlink:href属性引用,作为文字的路径。

  注意如果路径的长度小于文本的长度,那么只有在路径内的文字会被绘制。

  你也可以使用更复杂的路径,下面是一个比较复杂的路径制作路径文字的例子:

     Text along a more advanced path with lines and curves.  
Copy after login

  这个例子中。路径包括一条直线,一条斜线和一条曲线,得到的结果如下所示:
881.png

我们还可以制作路径文字动画,这要使用到元素,这个内容将在后面的文章中介绍,这里先来看一下它的效果:

882.gif

以上就是SVG基础|SVG TEXTPATH 元素的内容,更多相关内容请关注PHP中文网(m.sbmmt.com)!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!