How to style rich text elements in a dynamic list

Hey sorry but I’m just trying to figure this out too. Just to be clear I have a Rich Text field containing multiple paragraphs generated with the CMS. The line spacing is set and is fine but I want spacing between the paragraphs that are within the post.

When you say : “If you add a class to the rich text element you can specify how your paragraphs styles behave in just that class.” it seems like the control isn’t completely there, because this means you are editing the class for the whole block. What I’d like to be able to do is to define the class that relates to paragraphs within the rich text field and add a margin:bottom to it… I tried to get at it with custom code styling but couldn’t work out how to target the p element specifically.

I can get the effect I want by doing what @Mike said and changing the ‘all paragraphs’ bottom margin, but that of course effect paragraphs elsewhere on the site.

Am I missing something?

EDIT: edited to try and make this clearer, hope it makes sense…

Hi @joshuafry and @thesergie

I’ve set up an example site where you can see how to treat paragraphs differently. You have to add an Rich Text Block and give that a class. Then you can style these paragraphs differently from the other paragraphs.

When you initially want to style a paragraph in an RTB, don’t forget to click 'Nest selector inside of ‘[whatever you called your RTB]’ and then style it; you’ll see the difference with other paragraphs!

Success! And I added you, Sergie, because I now discovered that I can add a soft return in an RTB also! Don’t know whether I just missed that or that this was a bugfix, but I’m happy with it (again)!

This article may be helpful:

Thanks but as mentioned on the other thread I’m specifically talking about a CMS generated rich text field and the rules are seemingly a bit different as I can’t ‘get at’ the paragraph selector within these.

Maybe we could make this thread specifically about that? I should have delineated it from non-CMS related issues when I was in the other thread but this new title doesn’t quite reflect the problem…

Thanks - that’s interesting to see as I didn’t know about nest selectors, but unfortunately the option isn’t there in the same way when dealing with the text inside my RTB that is generated via the CMS. It’s essentially a blog post, and the paragraphs therefore aren’t split into Webflow ‘paragraph’ elements, there’s just one big RTF - even though technically in the way it’s then published they are paragraphs…

Hey @joshuafry at the moment the only way to do that is to drag a new rich text element from the add panel, give it the same class, and do the same process and it will affect the dynamic rich text elements. We’ll be working on making this much simpler. :smile:

1 Like

Hi @joshuafry, yes, you’re right [facepalm] Right now, rich text fields that live in a dynamic list have to be styled separately (this is a known limitation with our app and we are working on making this process much easier)

In the meantime, a workaround is to:

(1) Follow the usual steps for styling rich text elements on a “non-dynamic-list” rich text field:

(2) Add a dynamic list, connect it to your rich text field, then assign it the same class from the RTF from step 1.

Hope this helps! :slight_smile:

1 Like

cc @thesergie

Aha! Yes thank you both - that makes sense! I don’t mind limitations so long as I can find the workaround :smile:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.