Javascript – TinyMCE is changing the inline CSS

cssjavascripttinymce

I input this in the HTML editor:

<p style="border:1px solid #edede4;border-top:none"></p>

I click update, and click the html editor again. The HTML (in Firefox) has changed to:

<p style="border-style: none solid solid; border-color: -moz-use-text-color rgb(237, 237, 228) rgb(237, 237, 228); border-width: medium 1px 1px;" mce_style="border:1px solid #edede4;border-top:none"><br></p>

If I do the same thing in Internet Explorer, the HTML changes to:

<P style="BORDER-RIGHT: #edede4 1px solid; BORDER-TOP: medium none; BORDER-LEFT: #edede4 1px solid; BORDER-BOTTOM: #edede4 1px solid" mce_style="border:1px solid #edede4;border-top:none">&nbsp;</P>

Why in the world does it change? Maybe there are some TinyMCE settings i can change? But I already have cleanup: false. Ideas?

If I enable cleanup, the change I'm mentioning doesn't happen. However, TinyMCE changes a lot of other stuff. I don't want it to mess with my code 🙁 Any help would be appreciated.

Best Answer

Try setting verify_html to false.

Doc: TinyMCE Configuration/verify_html