Expand my Community achievements bar.

SOLVED

inline style support for RTE

Avatar

Level 1

Hi,

 

When we try to insert the following HTML markup inside the RTE field in source edit mode, the RTE strips off both the <style> tag and "id" attribute of "div" tag from the inserted HTML

 

<style>

#tp-left-menu {

height: 489px !important;

}

</style>

<div id="tp-left-menu">

...

 

I am not sure if this is the expected behavior, if it is, is there a way to override this behavior?

 

On the same lines, is there a support available to configure TinyMCE RTE in CQ

 

Environment: Adobe CQ6 Beta

 

Thanks, Prabu

1 Accepted Solution

Avatar

Correct answer by
Level 2

I have observed this behavior myself. However, it only strips ID's. Using class is perfectly fine, and arguably a better solution. FWIW, using style inside the body is not best practice anyway as it violates HTML specification, with the exception of HTML5 where the scope attribute is used. See: http://stackoverflow.com/questions/2830296/using-style-tags-in-the-body-with-other-html 

A few possible solutions you may consider are:

1) Put your css into your css file and create a rtePlugins configuration for styles. See this post for a tutorial on how to do that. http://blogs.adobe.com/contentmanagement/tag/custom-richtext/

2) Use inline styles

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

I have observed this behavior myself. However, it only strips ID's. Using class is perfectly fine, and arguably a better solution. FWIW, using style inside the body is not best practice anyway as it violates HTML specification, with the exception of HTML5 where the scope attribute is used. See: http://stackoverflow.com/questions/2830296/using-style-tags-in-the-body-with-other-html 

A few possible solutions you may consider are:

1) Put your css into your css file and create a rtePlugins configuration for styles. See this post for a tutorial on how to do that. http://blogs.adobe.com/contentmanagement/tag/custom-richtext/

2) Use inline styles