-
Anonymous
I usually add a gradient over background images.
On this example though I just want to add a gradient over the image in the image block.
I’m creating an a global style with :after psuedo element an then setting a background type gradient.
It’s not working, what am i doing wrong?
-
David
Hi there,
the
:before
and:after
pseudo selectors can’t be used on a<img>
as its a self closing tag.
So you would need to use a Container Block with the pseudo gradient and place the image block inside it.Let us know if you require more detail.
-
Anonymous
Thanks, so that all works ok using a container block.
But if I try to create a global style for the gradient to apply to each container block I don’t get the option of a pseudo element? Is that correct?
-
Alvind
Hi there,
You could. You can refer to this article:
https://docs.generateblocks.com/article/style-selectors/#more-selectors -
Anonymous
My question is not really covered in that document. Do you have a video on it?
Otherwise I will just add a class manually and write custom CSS for it.
-
Alvind
This video probably provides better insight:
Personally, in your case, I would write my own custom CSS as I would not be limited by using the UI controls to generate the global styles CSS.
- You must be logged in to reply to this topic.