Tagged: Colour section, CSS, image
-
AuthorPosts
-
September 27, 2021 at 12:46 pm #1322478
Hi all,
Just trying to get something to work and I can’t. I’m hoping someone can help. Trying to apply a mix-blend-mode to an image over the top of an image in a colour section:I have a colour section with an image background, over the top of which I have 4 columns. In one of the columns I have an image, with a Custom ID Attribute calling up the following CSS:
.blend img { mix-blend-mode: screen; }
This does not make the image blend with the background image, which is what I want.
If I add a colour background to the column, then the image blends with the colour (but not with the image in the colour section) so the CSS is doing something, just not what I want!
If I apply the CSS to the column the image is in, but not to the image, nothing happens.
I’m viewing it in Chrome and I’ve heard that Chrome won’t blend the image if the background is trans, so I tried adding a background colour to the colour section (even though you can’t see it because of the image) – but this made no difference.
I’ve also tried screaming loudly at the screen. This didn’t work either but made me feel better.
So how do I make an image in a column over the top of an image in a colour section blend with the image in the colour section?
Thanks In advance.
September 28, 2021 at 5:19 am #1322563Hey Thedogscreative,
Thank you for the inquiry.
This is not going to work with columns and color section because of how the containers are stacked up. The main color section container is not the direct parent of the columns, so the css property mix-blend-mode if applied to the column container or its content will not affect or will not blend in with the color section background.
// https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode
Markup:
<div class="example-container"> <img id="example-element" src="../../media/examples/firefox-logo.svg" width="200" style="mix-blend-mode: hard-light;"></div>
The mix-blend-mode property is applied to the image element, which works as expected because the example-container which has an orange background, is the direct parent of the image element.
Best regards,
IsmaelSeptember 28, 2021 at 10:43 am #1322606OK thanks for getting back to me,
So is there a way to achieve a full image background with mix-blend-mode images over the top in enfold?September 30, 2021 at 3:31 am #1322893Hi,
You might be ba able to do it with the Grid Row element and its cells as shown in the screenshot below.
Screenshot: https://imgur.com/f6DJLXw
The background of the main grid row container is red and the first cell is blue, with mix-blend set to hue. This works because the cells or the flex_cells are direct child of the grid row container.
Best regards,
IsmaelOctober 1, 2021 at 1:18 pm #1323148Brilliant, I’ll give it a go. Thanks.
October 2, 2021 at 4:32 am #1323224 -
AuthorPosts
- You must be logged in to reply to this topic.