Showing results for 
Search instead for 
Did you mean: 

How to add custom css in TinyMCE?

How to add custom css in TinyMCE?



I'm trying to build a new page in my onlineshop and it should look like this:


Can you help me where I can add the css styles?


I was trying to add them in the XMl section but this was not working Smiley Sad


Re: How to add custom css in TinyMCE?

TinyMCE disabled the ability to add them outside of the tags, so <style> tags are not valid XHTML, For this you will have to add style tags to the valid children configuration:

valid_children : "+body[style]"
So for Magento, you need to replace the code in lib/web/tiny_mce_4/tinymce.min.js:

to :

with :

now run the commands

php bin/magento s:s:d -f

php bin/magento c:f

check-in the below URL:

NOTE: It will render the CSS in admin, so admin layout will affect as per CSS

If issue solved, Click Kudos & Accept as Solution.
LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool

Re: How to add custom css in TinyMCE?

thx, it seems to complicated for me Smiley Happy