Streaming live at 10am (PST)

Apply text styles to container so that elements inherit those styles without adding classes?


#1

Hi,

Is there any way to apply text styles to a container so that any elements in the container inherit those styles without adding classes at the element level?

Developers I am working with on a project say that the problem is that when a block of content with different element styles needs to be content managed it is not possible to place classes on individual tags such as headings and paragraphs (Craft CMS).

They need to add some Javascript to bridge the gap between webflow classes and text styles on containing divs when creating templates in the CMS.

Has anyone else experienced this and is there any advice about how to prepare webflow projects so that this is not a problem?

Thanks,

John


#2

Yes, select it and apply styles. Be sure your content doesn’t have specific styles delcared already. In that case delete the properties already defined.

Avoid adding any text style to the content of the container. At least not the ones you want to see inherit.


#3

Hi Vincent, I am not sure if I am explaining myself properly, if I create a text bock with a class I can assign a style or I can select, for example, all H1 headings from the selector and style all H1 headings in the document.

But can I apply H1, H2, H3 and other text styles to a container (rather than the whole document) so that the styles are inherited by text blocks in that container without having to add classes at the element level?

How would I do that?


#4

This is to do with formatting tags in the context of content management. The developers cannot assign individual classes to separate text blocks in a content managed container, they would normally apply a range of styles to text tags, H1, H2 etc to the container so there would be no need for classes on the elements in the container, they would be H1, H2 and inheriting style from the container.