htmlckeditor

CKEditor allow <span> inside <a> tag


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>

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

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

How can I allow HTML tags inside a href?


Solution

  • 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.

    What u can do:

    1. Try doing it the other way: <span><a href="http://google.com">Link here</a></span>

    2. 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.

    3. 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... }

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

    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.