Creating Consistent Margins with Groups
Here's a quick Bubble tip for ensuring that your pages have got nice margins and nice consistent padding around your elements. I've got here a simple header and body content so you can see that my page width is not restricted, there's no fixed width which means that I get my light grey background going full width of the page and that my header is built up of an outer group which is also not set to fixed width and an inner group which is set to a... I've unchecked that and I've checked apply a max width when page is stretched so 100% so that means that the elements inside this group are contained to that max width and I've done the same with my body group here which contains like you can imagine putting charts in here on a dashboard or like a list of contacts.
Adjusting Element Sizes for Uniformity
These are contained also within a group that I've called body that has got a max width and so that way, probably easier to look here, I can adjust the size and it keeps everything central and uniformed. Now there is something a little bit frustrating that happens when I go all the way down I suddenly lose my nice margin which particularly doesn't look good if I have got rounded corners on these elements.
Fixing Margin Issues
So in order to fix that, there's two steps really, I need to put this in another group and then drag this out to the edge of... make sure I've got that parent group... drag this out to the edge. Now you'd think that would work because I've set yet another parameter within the elements on my page to ensure that this 20 pixel gap here remains. But if I go into the responsive engine, it's the old response engine not the new one, you'll see that actually exactly the same thing happens.
Workaround for Consistent Margins
So here's the workaround, my page width is 1240 and I would like there to be a 20 pixel engine on either side to make it look consistent. So I need to add 20 pixels either side so I'm going to add 40 pixels in total to my page width and just drag this all the way across again and center this and do the same with here. So I'm selecting the outer group, you can see I now have a 40 pixel gap down here and by centering this I end up with the 20.
Testing in Responsive Mode
So now if I go back into responsive, you can see that the 20 pixel gap continues no matter how small I make it. And I believe that that is an intentional setup by Bubble that if you create a group and you drag it right to the edge of the screen it behaves as if it's anchored to the edge of the screen.
Ensuring Consistent Gaps
But by forcing there to be this gap, so this is the top of the structure of my page, my page body and I force there to be this 20 pixel gap between the page body and this container here. And once more you can see that it ensures that a 20 pixel gap is carried all the way down to the smallest size.