This is a migrated thread and some comments may be shown as answers.

Body tag class editor

1 Answer 39 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Darryl Clark
Top achievements
Rank 1
Darryl Clark asked on 02 Oct 2008, 12:13 PM
I am currently running editor 7.3.2 which I upgraded to from 6.5.2. I have a problem of applying styles to the editor area. My 6.5.2 version puts a class in the body tag of "RadEContentBordered" within the html area when it renders to the page. This was useful as I use a shared style sheet between front and backend. In the new version the body tag has no class which makes styling difficult. The way I styled the old version was to have #content li, .RadEContentBordered li {} etc...

Have I changed something or is it possible to easily put the class back in. I have lots of editors across my admin area so a central change would be appreciated.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Oct 2008, 12:44 PM
Hi Darryl,

By default, RadEditor 7.3.x copies and applies the body css class from the parent page in which it resides in order to display its content identically to the content on the parent page. If you want to prevent this operation you need to set the CssFiles property to point to your own external css file. To style the HTML elements in the content area you should define global css classes for them, e.g.

body { color: red;}
table {...}

tr {...}
td{...}
div {...}
li{...}, etc


Thus the editor will not pick up the styles from the parent page and it will apply only the classes in the external css file to the content area elements.

You can find more information here.

What you can do when displaying the content on the public site is to wrap it in some parent html element having a static ID for example "myContent". After that you will be able to apply css class to it with the following css class:

<style>
#myContent li
{
    color: red;
}
</style>


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Darryl Clark
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or