Issue #2651Opened March 14, 2020by orionseye0 reactions

[QUESTION] Background image via inline style not accessible?

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, 20200 reactions

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 to access the background image the easy way. Instead he has to toggle the correct class, then access the style. And if the element (like in my demo) is absolute positioned .. it just disappears .. and the user (obviously) too.

I saw a configuration for that from Artur .. but don't remember where

orionseyeMarch 14, 20200 reactions

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 background image layer.

I must admit, that this is hard stuff...especially to teach people how todo that. Anyway, problem solved, but my recommendation would be, that this needs a fix.

artfMarch 19, 20200 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.