Site logo

Archived topic

Use new Image block as background image.

25 replies · Started by Rostyslav on June 30, 2022

Viewing posts 16–26 of 26

Something is not working because on mobile is working bad and the wrapeer's containers are messing.

You have this CSS which is affecting your new Container image as well:

.has-background-image .gb-inside-container figure {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

Replace it with something like this so it doesn’t affect other images:

.has-background-image > .gb-inside-container > figure {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

Kindly let us know how it goes.

Thanks guys! Its working perfect! I am not closing the topic in case of future questions about it.

You’re welcome Rostyslav!

David, you are GENIUS! Seriously! Thank you for putting up with.

Glad to be of help :)

Hello again!

I inside a container I have more that one image. To make the first one as background without affectig the other ones. Is this code okay?

.has-background-image {
	position: relative;
}

.has-background-image .gb-inside-container > * {
	position: relative;
	z-index: 1;
}

.has-background-image > .gb-inside-container > figure:first-child{
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.has-background-image .background-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: -1;
}

Thanks

Yeah that would work :)

This archived topic is closed to new replies.