Site logo

Archived topic

Adding inline CSS to Block elements

1 reply · Started by Ben on September 13, 2022

Viewing posts 1–2 of 2

Hi,
When using block ELEMENTS, how can I add inline styles that target the specific block and only load when the block is loaded? The CSS I want to add are options that are not available in standard block settings.

I use Simple CSS for global AND page specific CSS, but would really like to have this option on template blocks (elements)

Many thanks for any help.

Ben

Hi there,

you can't inline styles in the Blocks HTML, as the editor will basically reject those changes.
if you want to just load some CSS in that block element then you can:

1. insert a HTML Block as the top most block in the Element.
2. in the HTML block add your CSS Styles.
2.1. make sure to wrap the CSS in style tags eg.


<style>
/* Your CSS */
</style>
This archived topic is closed to new replies.