Site logo

Archived topic

Design difficulties

8 replies · Started by Leonardo on September 2, 2022

Viewing posts 1–9 of 9

Hello how are you?

I'm trying to achieve a design I made using Figma, but I got to a part that I can't adjust... Could any of you guys give me any ideas? The difficulty is in leaving the images "cropped", as I did in Figma. Send more information in private.

Note: increase and decrease the size of the browser screen to get an idea of ​​how it is working...

Leonardo M.

Hi there,

the login you provided is not recognised - can you resupply ?

Sorry! Check the new data, please.

Ooh, thats fun :)

Ok, so select the top Container with the mono background image. And in Advanced > Additional CSS Class(es) add:

fixed-aspect

then add this CSS:


.fixed-aspect {
    aspect-ratio: 1512 / 794;
}

That will force the container block to maintain the aspect ratio which i set to width / height of the background image.
That should help.

Thank you, David!

I made a small change, because opening it on my ultrawide monitor I need to increase its adjustment a little bit.

The only thing I would like would be to have the texts all automatically centered vertically.

The one in the black and white photo, for example, is always on top.

Hi Leonardo,

You can try adding this CSS as well:

.gb-container.fixed-aspect > .gb-inside-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 100%;
}

.gb-container.fixed-aspect {
    position:relative;
}

How about something like:

.fixed-aspect {
    aspect-ratio: 1512 / 524;
    background-position:bottom center !important;
}

You can also set the background position in the GB Block settings instead of through code.

This archived topic is closed to new replies.