Community forum for knowledge and support

Updated 10 months ago

Aligning content with sections when using a component with left or right column without padding or margin

At a glance

The community member is asking how to align the content of a component with a left or right column that has no padding or margin when using a "container large". A community member responds with a suggested solution: create a new container that is approximately half the width of the "container large", give it auto margin on the left and zero margin on the right, and set it to 100% width. This way, the new container will only go as far out on the left as the regular "container large". The original poster confirms this is exactly what they were looking for and plans to try it.

Hey guys, when you use a component that has either left or right column with no padding/margin how do you get the rest of the content to align with the rest of the sections when using a container large for example, here is a screenshot to show you what I mean, and showing the desired effect if there is a better way of doing it.

R
H
3 comments

Hey

Do you mean like this?

Let's say you're using container large. It's got a max size of 40 rem.
If it's nested inside padding-global at 2.5rem, then you need to add a similar padding (responsive of course) only on the side that needs to match the same container side (i'm using the blue/left in this case).

Make a new container, make it approximately HALF the width of container large (in my case, 41rem was the perfect size). Give it AUTO margin on the left and ZERO margin on the right. 100% width.

That way it will only go as far out on the left as your regular container large.

Should work πŸ‘ Hope that helps!

Hey Rob, this is exactly what I mean. Thanks dude I will give it a crack in the morning πŸ™‚

Add a reply
Sign up and join the conversation on Slack