can we append inline styles in RTE instead of classes | Community
Skip to main content
Level 3
June 17, 2022
Solved

can we append inline styles in RTE instead of classes

  • June 17, 2022
  • 3 replies
  • 1639 views

Hi,

 

Can we append inline styles directly instead of custom classes in RTE

 

Example : when custom style is selected in RTE it is appending as

<span class="text-blue"><span> instead of that can we append inline styles 

 

like <span style="font-size: 23px;
color: #FFF;"></span>

 

Please provide suggestions!

 

Thank you!

 

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 MayurSatav

Hi @satish2info-1 ,

 

Yes, you can do that using the RTE source edit plugin. But if it is removing your style attributes after submitting dialog then you need to enable those attributes from xssprotection.xml file. Check out this blog for more details.

 

 

3 replies

SantoshSai
Community Advisor
Community Advisor
June 17, 2022

Hi @satish2info-1 ,

If you have enabled source code plugin, IMHO It's absolutely OK to have inline styles with RTE. I have used many times in my past specially in Email Campaign.

However, It is best practice to add styles through dialog 

Reference: https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/configure-rich-text-editor-plug-ins.html?lang=en#text-styles

Hope that helps!

Regards,

Santosh

Santosh Sai
Level 3
June 19, 2022

Hi @santoshsai 

Thank you for your reply,

 

Yes, we can able to achieve with RTE but my question is when we using the RTE when we select the particular style it will append corresponding style class instead of that i have to append direct style in RTE. Can we able to do this?

 

like :

 

RTE works like : <span class="text-blue"><span> instead of that can we append inline styles 

 

but i have to append directly  inline styles <span style="font-size: 23px; color: #FFF;"></span>

 

Regards,

Satish.

arunpatidar
Community Advisor
Community Advisor
June 19, 2022

Hi,

For the email templates, you can use internal css styling and still live with class name instead of inline styling.

 

Arun Patidar
MayurSatav
Community Advisor and Adobe Champion
MayurSatavCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 20, 2022

Hi @satish2info-1 ,

 

Yes, you can do that using the RTE source edit plugin. But if it is removing your style attributes after submitting dialog then you need to enable those attributes from xssprotection.xml file. Check out this blog for more details.

 

 

kautuk_sahni
Community Manager
Community Manager
June 20, 2022

@mayursatav , great blog, thank you for creating it 🙂 

Kautuk Sahni
MayurSatav
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 20, 2022

Thanks @kautuk_sahni