CKEditor允许& lt; span& gt;内部& lt; a& gt;标签 [英] CKEditor allow <span> inside <a> tag

查看:134
本文介绍了CKEditor允许& lt; span& gt;内部& lt; a& gt;标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在CKEditor源代码中的< a> 标记内添加&span> 标记:

I want to add <span> tag inside of an <a> tag in the CKEditor source:

<a href="http://google.com"><span>Link here</span></a>

但是当我在CKEditor中以源代码模式添加HTML时,它会将其转换为:

But when I add the HTML in CKEditor in source mode, it converts it to:

<a href="http://google.com">Link Here</a>

如何在 href 中允许HTML标签?

How can I allow HTML tags inside a href?

推荐答案

您真的需要在其中放置< span> 标签吗?在您的链接中添加一个类并从那里编辑它(我想您想要的CSS)不是更好.

Do u really need to put the <span> tags in there? Isn't it better to add a class to your link and edit it(the css I guess u want) from there.

您可以做什么:

  1. 尝试以其他方式进行操作:< span>< a href ="http://google.com">链接此处</a></span>

在记事本/PSpad或任何总是向您显示罕见源代码的文件中打开html文件,然后尝试将其写入此处-没问题.

Open your html file in Notepad/PSpad or anything that always shows you the rare source code and try to write it there - shouldn't be a problem.

正如我已经写过的-如果您想在那里编辑链接文本的CSS,请在您的链接中使用class并编辑CSS值.示例:< a href ="http://google.com" class ="myLink">此处链接</a> css : .myLink {...您的自定义设置...}

As I already wrote up - if u want that span there for editing css of the link text - use class in your link and edit css values. Example: <a href="http://google.com" class="myLink">Link Here</a> and in css: .myLink { ...your custom setting... }

如果您可以告诉我们您需要什么span标签,它将帮助我们回答:)

If you could tell us for what you need the span tags there it would help us answering you :)

P.S .:很抱歉,我没有回答您使用的编辑器.我只是认为您可能想尝试其他不会禁用编写代码时通常可以做的事情的编辑器.

P.S.: I'm sorry that I'm not answering about the editor you are using. I just think you might want to try other editors that don't disable stuff u usually can do when writing the code.

这篇关于CKEditor允许&amp; lt; span&amp; gt;内部&amp; lt; a&amp; gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆