Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Paul Marden 235 posts 338 karma points c-trib
    May 02, 2011 @ 17:26
    Paul Marden

    Insert Span inside an H2 in TinyMCE

    I want to have a headline that looks like this....


    I can easily create a style that appears in the styles drop down menu which inserts the <h2> or the <span> with just one style.  What I can't do is get it to insert both.  Any ideas if this is possible?


  • Jan Skovgaard 11264 posts 23590 karma points MVP 8x admin c-trib
    May 02, 2011 @ 18:19
    Jan Skovgaard

    Hi Paul

    Have you tried using both <h2> and a class for the span in combination? So that you first mark the text as a <h2> and afterwards marks it with the other style?

    Otherwise I'm thinking you should perhaps consider making a tinymce template for this? You can read more about it here:

    I don't suppose adding the span manually through the HTML view is an option?


  • Gerty Engrie 122 posts 472 karma points c-trib
    May 02, 2011 @ 23:19
    Gerty Engrie

    I have a way, but not a nice one :p if you have a style 'h2' (style on h2) and a style 'test' (class .test) in your dropdown...

    • enter some text and add a char on the end of your text, like a . or so
    • put cursor in text
    • choose 'h2'
    • select the text without the . 
    • choose 'test'
    • remove the . in the end

    that should give you <h2><span class="test">your title</span></h2>

    the reason for the . is that when you select the whole text it will make : <h2 class="test">your title</h2> ....

    not an ideal way but a way.... don't know if there's a way to insert both at the same time, would be nice :)

Please Sign in or register to post replies

Write your reply to: