More in this section

Forums / Developing with Sitefinity / Editor applying css class

Editor applying css class

3 posts, 0 answered
  1. Michael
    Michael avatar
    31 posts
    07 Sep 2007
    26 Dec 2008
    Link to this post
    I have some custom css class that I have available in my content editor, but that only work if they are applied to a div not span.   Is there a way to tell the editor when applying  css class to make this code:

    Current: <span class="my_class">my content</span>

    What I want: <div class="my_class">my content</div>
  2. John
    John avatar
    32 posts
    08 Oct 2008
    26 Dec 2008
    Link to this post
    Hi Mike,

    The Generic Content module is using the RadEditor for ASP.NET AJAX and that has a drop down for selecting a CSS Class. You can simply click on a word, with that css class applied, and the drop down box will change to the CSS Class. Try it on this online demo.

    By default, this is turned off in Sitefinity. To turn it on, follow these steps:

    1. Open this file: ~\Sitefinity\Admin\ControlTemplates\EditorToolsFile.xml
    2. Add this line of code inbetween any of the <tools> tags:
          <tool name="ApplyClass" />

    The RadEditor has an HTML view too, which you can get by clicking on <>.

  3. Georgi
    Georgi avatar
    3583 posts
    28 Oct 2016
    29 Dec 2008
    Link to this post
    Hello Michael,

    I was able to apply the classes both on div and span elements in our demos - RadEditor Demo page.
    Could you please edit your CSS classes and see if that will make any difference? We will need your css classes and RadEditor config files in order to replicate the same problem locally.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
3 posts, 0 answered