We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4429
    • 429 Posts
    There are a few thread on styles on TinyMCE styles, but i haven’t seen one that covers my issue.

    i am trying to add styles to the dropdown box in the editor.

    The default for this is:

    displayname=styleelement;displaynam2=styleelement2 etc...

    However the style is i my CSS is;

    #box1 h2


    I have tried adding that to TinyMCE but it doesn’t appear to be working. e.g
    Boxheader=box1 h2;Boxcopy=box1 p


    Is there a way to get this to work without changing the code in my stylesheet?
      • 4429
      • 429 Posts
      Sorry to bump this - but does anyone have an idea on this?

      I guess it might be limitation
        • 3072
        • 20 Posts
        I think you should use classes here not ids.
        Ids make sense in templates, but not in WYSIWYG-Editors.
          • 3707
          • 241 Posts
          I might of misunderstood what you’re trying to do but your CSS rule would apply styles to a h2 element inside another element with an ID of box1.

          The styles drop-down menu will only apply styles to an element that already exists. In which case, your CSS rule would have to be h2#box1.

          If you want to wrap an element around the h2 i.e. a div, you would need to insert some predefined template code. There is a TinyMCE button for doing this, take a look at this thread to see if it helps.
            • 4429
            • 429 Posts
            Quote from: bob1000 at Feb 12, 2009, 06:16 AM

            I might of misunderstood what you’re trying to do but your CSS rule would apply styles to a h2 element inside another element with an ID of box1.

            The styles drop-down menu will only apply styles to an element that already exists. In which case, your CSS rule would have to be h2#box1.

            If you want to wrap an element around the h2 i.e. a div, you would need to insert some predefined template code. There is a TinyMCE button for doing this, take a look at this thread to see if it helps.

            No problem. I just renamed my elements and made them classes. Works fine now.