Archived topic
Forcing grid container to be always square
3 replies · Started by Igor on November 27, 2022
Hi Guys,
Is it possible to force the grid container to always be in square aspect ratio? Thank you!
Hi Igor,
To clarify, are you referring to a default Grid container or a GB Container Block?
In any case, it should be possible. You'll just need custom CSS.
Can you provide the specific link and point us to the Container you wish to have a "square" aspect ratio?
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Hi Fernando,
Thanks for quick response! I think I solved the problem with a simple css code "aspect-ratio: 1 / 1;"
I'm still not sure if this works in all browsers, but it does the job for now.
Thank you!
Glad you resolved the issue! That's the ideal solution as well, and it should be compatible with all current Browsers. Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio#browser_compatibility