Styles not applying to some elements, Gallery Disappears in TinyMCE, WP 3.5 Styles not applying to some elements, Gallery Disappears in TinyMCE, WP 3.5 wordpress wordpress

Styles not applying to some elements, Gallery Disappears in TinyMCE, WP 3.5


Seems to be related to a chrome bug. It will be fixed in Wordpress 3.6. (see: http://core.trac.wordpress.org/ticket/24177)

It is suggested to rename the css-classes from wpGallery to wp-gallery.


Surprised to see someone with the same obscure problem as me.

What I did to work around this was move my CSS to the image's style attribute. Of course I had complete control over the elements being rendered... not sure if it'll help in your case.


Looks like a simple workaround is to go through the tinymce.activeEditor.contentDocument.getElementsByTagName('img') elements and set element.className = element.className. (This can be added in many handlers like onClick, onChange, etc. to prevent the weird state when the class doesn't apply itself.)

This seems to be a good workaround, but I would like to know how/why TinyMCE with Webkit gets in this odd state though.