Copied to clipboard

Flag this post as spam?

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


  • Matt Whetton 19 posts 61 karma points
    Jan 27, 2014 @ 12:11
    Matt Whetton
    0

    Rich text editor style to wrap multiple lines

    Is there any way to get a style in the rich text editor to wrap multiple lines?

    I'm trying to wrap a heading and paragraph in a div (with a specific class), but when I select the style it wraps each row independently.

    So what I want is this:

    <div class="myclass"><h2>title</h2><p>some text</p></div>

    But I actually get this:

    <div class="myclass"><h2>title</h2></div><div class="myclass"><p>some text</p></div>

  • Per Ploug 865 posts 3491 karma points MVP admin
    Jan 27, 2014 @ 13:54
    Per Ploug
    0

    Hi Matt

    I think this is because of the way that TinyMCE sees these elements, as it either sees them as block elements, or inline elements when applying styles, and since both H2 and P elements are seen as block elements it wrap each one in its own block for this class.

    TinyMCE is not a html editor, so it will probably not always do as you want it to do, this is one of the compromises you make with having a visual editor for your html = its easier to do for non technical uses, but it doesn't always do what you want it to technically.

Please Sign in or register to post replies

Write your reply to:

Draft