Can someone help me write a custom code (javascript?) to change the attributes of a class inside a rich text field in a cms item. The text itself has been imported through the Webflow api from an external source. The incoming text is formatted in html but some attributes makes the text justified and sets Arial as font. These settings disrupt the design of my page where I want the font set on the rich text class (Muli font) and text should be left aligned.
Hi @catino You do not need JS to do that you can just use CSS with pointers as eg.w-richtext p etc. to add your styling, BUT first clean up code mess in your page template settings.
Script should be in before body tag. I do not know why you have uncommented styles but even that your comment-out have wrong syntax and it may cause problems. After use standard CSS to style your elements.
Thank you very much for your reply.
I’ve now cleaned up inside head and instead added a few lines to body. I’ve tried to style the ul li elements through the div class .rich-text.pr.w-richtext. It doesn’t work. I guess I haven’t fully understood how to style the classes in the custom code. How do I properly call on the correct class?
I am writing it like this: <style> div.rich-text.pr.w-richtext ul li {text-align: left;} </style>