Styling children?

I’m not finding a way to do the very basic CSS function of styling children based on their parent class. i.e.,

div.container-2 p {
/* styles for all paragraphs under container-2 */
}

It seems that in order to style children under a specific parent I have to apply classes to each of the children also. Is that correct?

Webflow does not support CSS descendant selectors or combinators so it can only be done by using custom code. If you do a style block as an embed it will reflect in the designer, if you use code in your head or an external stylesheet it will not.

Yes, that is correct. Or set a default style for each element type.

Why Webflow continues to not support basic CSS selectors is beyond me.

1 Like

There is actually a partial solution, that can work but only for elements supported into Richtext. Basically since you can only style children of a richtext you can style them into a richtext and simply apply the richtext class in the normal element you have. You are limited to simple elements like p, a and headings, but it’s better than nothing! Also works with odd and even selectors by using collection list wrappers

Thanks. It’s like they don’t understand the “cascading” part of “cascading style sheets,” although I can see how it would be hard to add in the current interface.