inline style support for RTE | Community
Skip to main content
prabudossh69718
New Participant
October 16, 2015
Solved

inline style support for RTE

  • October 16, 2015
  • 1 reply
  • 1280 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by pakram

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

1 reply

pakram
pakramAccepted solution
New Participant
October 16, 2015

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