为了账号安全,请及时绑定邮箱和手机立即绑定

Namespace prefix xlink问题

我写出来的代码会有这样的问题:

This page contains the following errors:


error on line 5 at column 29: Namespace prefix xlink for href on textpath is not defined

Below is a rendering of the page up to the first error.


正在回答

1 回答

哦,写在html中就好了,直接写成svg是不行的;

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>textpath</title>

</head>

<body>

<svg xmlns='http://www.w3.org/2000/svg' width='800' height='600'>

    <path id="path1" d='M 100 200 Q 200 100 300 200 T 500 200' stroke='rgb(0,255,0)' fill='none'>

    </path>

    <text style='font-size:24px;'>

        <textpath xlink:href='#path1'>

            这个文字先上去,又下来了。Upside down in english!

        </textpath>

    </text>

</svg>

</body>

</html>


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
走进SVG
  • 参与学习       52652    人
  • 解答问题       213    个

SVG是HTML5 中矢量图的标记语言,学习后掌握更多的干货

进入课程

Namespace prefix xlink问题

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信