- This topic has 8 replies, 3 voices, and was last updated 6 months, 2 weeks ago by
Fernando.
-
AuthorPosts
-
September 2, 2022 at 4:06 pm #2331966
Leonardo
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.
September 3, 2022 at 2:57 am #2332215David
StaffCustomer SupportHi there,
the login you provided is not recognised – can you resupply ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 5, 2022 at 5:21 am #2333757Leonardo
Sorry! Check the new data, please.
September 5, 2022 at 7:46 am #2333872David
StaffCustomer SupportOoh, 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 5, 2022 at 11:12 am #2334155Leonardo
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.
September 5, 2022 at 11:14 am #2334156Leonardo
Just look at this print I took on my monitor:
https://germinlab.com.br/wp-content/uploads/2022/09/imagem_2022-09-05_151257271.png
September 5, 2022 at 6:22 pm #2334307Fernando Customer Support
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; }
September 6, 2022 at 11:54 am #2335213Leonardo
It worked, Ferdinand!
However, I wanted to reduce the size of the black and white image a little and then the effect was lost…
.fixed-aspect {
aspect ratio: 1512 / 520;
}Remembering that the desired effect is this: https://germinlab.com.br/wp-content/uploads/2022/09/Sem-titulo.png
September 6, 2022 at 5:36 pm #2335374Fernando Customer Support
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.
-
AuthorPosts
- You must be logged in to reply to this topic.