Marc1234
(Marc)
March 12, 2025, 12:55pm
1
Hey folks,
I’ve started building a lightbox on my homepage (3 images and media).
The individual Lightboxes have been added within a 3x3 Grid.
The media are different aspect ratios but I want the Grid/Lightbox imagery to display square.
How do I achieve this? No amount of playing with sizes on Grid or Lightbox etc…is making a difference.
Many thanks for your help.
Here is my site Read-Only: [LINK ](Webflow - Marc Motion Design )
(how to share your site Read-Only link )
addweb
(AddWeb Solution)
March 12, 2025, 1:18pm
2
@Marc1234 You can use the following CSS properties to ensure the image adjusts according to the parent div:
width: 100%;
height: 100%;
object-fit: cover;
This will make the image fit properly within the container. See the reference screenshot for more details.
1 Like
Marc1234
(Marc)
March 13, 2025, 9:42am
3
Thanks so much!!! I’ll give that a go
Marc1234
(Marc)
March 13, 2025, 9:47am
4
OK, how do I even find the CSS to edit it? The CSS preview only allows me to preview :) Thanks again
Marc1234
(Marc)
March 13, 2025, 9:56am
5
I managed to paste that copy into the same section you did in the screenshot but nothing happens, the boxes still display incorrectly. Any help gratefully received. Many thanks
addweb
(AddWeb Solution)
March 13, 2025, 9:58am
6
You are targeting the wrong tag. Target img tag.
Marc1234
(Marc)
March 13, 2025, 10:01am
7
Thanks for your response - I can’t find the img tag in the code how do I isolate it? thanks again
addweb
(AddWeb Solution)
March 13, 2025, 10:03am
8
Please see this screenshot:
Marc1234
(Marc)
March 13, 2025, 10:17am
9
Thanks for all your help! that image still displays like this when I add that code in and make my settings the same as your in the screenshot:
addweb
(AddWeb Solution)
March 13, 2025, 10:21am
10
Please in the height section write 100% and press enter and check.
Marc1234
(Marc)
March 13, 2025, 10:24am
11
Thank you that makes images 20 and 19 the same size. How do I make the content appear in a square?
addweb
(AddWeb Solution)
March 13, 2025, 10:33am
12
Set this two parent div:
width: 30vw;
aspect-ratio: 1 / 1;
Marc1234
(Marc)
March 13, 2025, 10:45am
13
Amazing - thanks for all your help :) One more thing - How do I get the column to centre? Thanks!
Marc1234
(Marc)
March 13, 2025, 10:58am
15
Thanks, do I add that to all Images or all Lightbox Links?
addweb
(AddWeb Solution)
March 13, 2025, 11:13am
16
Yes, you can add it to others too, but it’s better to create a common class and reuse it in other places.
1 Like
Marc1234
(Marc)
March 13, 2025, 11:15am
17
Thank you but should that code be added on just the Images or the Lightbox Links classes?
addweb
(AddWeb Solution)
March 13, 2025, 11:20am
18
to make centre you need to apply on Lightbox Links classes
1 Like
Marc1234
(Marc)
March 13, 2025, 11:23am
19
Amazing thanks so much for your help!!! That worked :)
1 Like