CKEditor允许< span>在< a>内部标签 [英] CKEditor allow <span> inside <a> tag

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

问题描述

我想在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 ?

推荐答案

您是否真的需要放入< span> 标签在那里?

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>

打开您的html记事本/ PSpad中的文件或任何总是向您显示罕见源代码并尝试在其中写入的文件-应该没有问题。

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 :)

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

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允许&lt; span&gt;在&lt; a&gt;内部标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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