Issue #2651💬 AnsweredOpened March 14, 2020by orionseye0 reactions

Background image via inline style not accessible?

Quick answerby orionseye

Strange .. i have explicitly to use specific class to access the background image (in my case it's class .bg) #desc-text-6 .bg will not work. Now, since .bg is a global style declaration, i need to make use of #desc-text-6 .bg Even adding a new class for my background only, again the editor makes it hard for the user...

Read full answer below ↓

Question

This is very simple, but i can not access the background image set via CSS, within my custom block 'content'. How do i change the background image here? (even editor.getCss 'sees' the style) https://codepen.io/dimimet/pen/NWqYmbB

Cheers!

Answers (3)

orionseyeMarch 14, 2020

Strange .. i have explicitly to use specific class to access the background image (in my case it's class .bg) #desc-text-6 .bg will not work. Now, since .bg is a global style declaration, i need to make use of #desc-text-6 .bg Even adding a new class for my background only, again the editor makes i...

orionseyeMarch 14, 2020

Never mind.. reading half of the issues here, i saw that there is a little 'checkbox' next to the selected classes, which let me toggle the class view on/off. That way, i can add unique class now and assigned my bg-image to that ..then clicking on the lil checkbox, it will allow me to 'access' the...

artfMarch 19, 2020

Now, since .bg is a global style declaration, i need to make use of #desc-text-6 .bg

No, actually there are absolutely no good reasons to use a selector like this #desc-text-6 .bg, just create a single class for your element and point your CSS to it, no more checkbox to toggle...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.