But no matter what I do, instead of adding a class to an IMG tag TinyMCE keeps surrounding my IMG tag with a new SPAN with that class. How can I style IMG tag directly as at the wiki page above. Am I missing something? I am using Umbraco 7.1.1.
This behavior has been like that for as long as I can remember between Umbraco versions. Not sure how to fix it.
But I think the easy way around it would be to make sure that your CSS takes into account that the class is sometimes sourrounding the image and sometimes it is placed directly on the tag.
So in your CSS do something like
.yourclass > img,
.yourclass
If you think this is something that should be changed you could try adding a request for it on the issue tracker
I hit this issue also and needed a quick solution, so ended up creating a new class to do the trick, not sure if this is the best solution though it works. You could certainly adapt it to suit your needs.
Styling img tag
Hello!
I am trying to style img tag exactly as here http://our.umbraco.org/wiki/recommendations/recommended-reading-for-content-editors/adding-styles-to-the-tinymce
But no matter what I do, instead of adding a class to an IMG tag TinyMCE keeps surrounding my IMG tag with a new SPAN with that class. How can I style IMG tag directly as at the wiki page above. Am I missing something? I am using Umbraco 7.1.1.
Thank you.
Hi Petr
This behavior has been like that for as long as I can remember between Umbraco versions. Not sure how to fix it.
But I think the easy way around it would be to make sure that your CSS takes into account that the class is sometimes sourrounding the image and sometimes it is placed directly on the tag.
So in your CSS do something like
.yourclass > img, .yourclass
If you think this is something that should be changed you could try adding a request for it on the issue tracker
Hope this helps.
/Jan
Hello Jan!
I am not happy with code polluted with unnecessary tags, but your solution will do the job. Thank you for taking time to reply to my question.
Hi Petr
I understand that and I feel the same way. But sometimes it's just hard to be perfect when you're not in complete control of the code.
Remember to mark the post as solved btw :)
Cheers, Jan
Hi Guys,
I hit this issue also and needed a quick solution, so ended up creating a new class to do the trick, not sure if this is the best solution though it works. You could certainly adapt it to suit your needs.
Hi Darren
Thanks for sharing the above code - Someone will certainly be able to benefit from this :)
H5YR!
/Jan
is working on a reply...