-
Hi guys, I’m having difficulty keeping the padding on sections with grids the same size. When I add new sections I’m not sure what’s the best way to keep everything aligned so it matches the design I’m working with. Should I be setting an layout element or just adding right/left spacing to each section?
-
hi there,
Can you specify the issue you are having?
-
Hi Ying,
I’m having difficulty keeping the padding on sections with grids the same size. If you look at the 4th section that starts with ‘OD&BOSS WHERE BRANDS BECOME ICONIC’ I want the images and text in that container and the container below to be lined up and have the same padding on each side. I’ve added the same padding but they are not in line with one another.
Thanks
-
For simple sections like this, I would not use Grid block, but a parent container with 2 child containers instead.
The parent container will be set to
display:flex
, you can define acolumn-gap
, and you can define thewidth
for the child containers.Let me know if this is clear 🙂
-
Thanks Ying, can I ask why you would use a container with 2 child containers over a grid? Alos, how can I centre align the two containers vertically and horizontally like I would the grid ?
-
can I ask why you would use a container with 2 child containers over a grid?
Grid has more levels of HTML and CSS codes, it’s very handy for multi-row layout.
However, your layout is just one row, the HTML and CSS of 1 flexbox container with 2 child containers is much lighter then a Grid block.
Alos, how can I centre align the two containers vertically and horizontally like I would the grid ?
You can use the flexbox alignment matrix to align the content inside.
-
Perfect, thanks for that explanation Ying 🙂
-
thanks for you your help here Ying. I’ve updated the sections but I’m still seeing extra padding on the right and the containers aren’t aligned with their padding. Can you pinpoint what I’m doing wrong?
-
Do you mean the “FROM BEHIND THE LENS” section?
Not sure what you mean by extra paddings on the right, the paddings on the left and right look the same to me.
Let me know!
- You must be logged in to reply to this topic.