Container 16 and 17 are spilling over to the R making everything slightly off center in Tablet and smaller views (not really dead centered in Desktop either). The section above is not and I think it is setup the same. I’m sure I’m missing some simple setting somewhere. Only difference I can see is the good one is flexbox horizontal and the others are vertical. All are set to 100% width. What am i missing?
I tried making the X axis left and it didn’t seem to help. This is specific to the Coral page.
On container16 with 100% width, you’ve added 2rem margin on both sides. Instead of using margin, it’s better to use 2rem padding on both sides of the container.
Element overflows its container:
A 100% width element already takes up the full width of its parent container.
Adding horizontal margins (left/right) effectively adds extra space outside the element.
This can cause the element to overflow the container, creating unwanted horizontal scrollbars.
To add-on to the above suggestion, if you need some space between the page and the Container 16 element, you can have padding instead of margin as follows:
And also make sure you reset the Width property of Div Block 30 element to get rid of extra space on the right side of the page as follows in the tablet breakpoint:
Thank you, I’ll look at that. I added the 2 REMs to try and pad it on each side. However, what made me notice it wasn’t centered was I need 6 on the right, and only 2 on the left to center it. I’d think the 2REMS would make it spill on both sides….oh, are ypu saying the 2 on the right pushed it off the left to begin with?
I’ll check it out - thanks for looking and providing some insight. Much appreciated!
@IPT , Using padding inside the container is usually the better approach, as it keeps the content centered while maintaining consistent spacing on both sides.
Glad I could help — If the issue has been resolved, please mark it as “Solution.” Thank you!
Separate elements from each other: Example: You want a paragraph to not stick directly to the heading above it.
Push elements away from the edge of a container: Example: Centering a block element horizontally.
div {
width: 200px;
margin: 0 auto; /* top/bottom = 0, left/right = auto */
}