Responsive Design-Set Page Width When Element Width to Decrease

I often find it hard to get elements to function exactly as I’d like them to when my page is large, but my element is half the width but centered on the page.

When I want the element to maintain its width until the page is the same size, but then begin to decrease so the element maintains in center and doesn’t decrease it’s width when the page width is first less than its width in the editor.

For example. Page is 1200px. Centered group is 600px. If you are to allow the group to maintain center all the way to 300px and keep a margin, you have to allow the centered group to have a low percentage of minimum width…The problem with this is that as soon as the page is less than 1200px the centered group width begins to decrease.

What would be nice is if we could set (similar to a hiding rule) a page width rule for when the element can begin to decrease it’s width. For example, I could set a rule to only decrease the centered width when the page width is less than or equal to 640px so that at 640px page width, my centered group is still 600px, but by the time I get to page width 300px the centered group would be 260px.

This group at 1200px page width

This group at 360px page width

This all looks great. However, This group at 900px page width

It should still be 600px not 340px…this would be possible to fix bad UI if we had a rule to place on when to allow the current minimum width to begin.

Yeah, that’s actually a good idea. Maybe Bubble can add that feature. That would be cool. :+1:

In the mean time. One way to fix it… you can add groups as spacers to the sides of it, if possible. This will allow the group to shrink slower.

The responsive settings try to keep the margin on the left and right side when something is centered. So it shrinks as fast as you shrink the page. The spacers allow for a slower shrinking of the element.

Hope that helps! :blush:


For All Your No-Code Education Needs:

  • One-on-One Tutoring
  • eLearning Hub
  • Video Tutorials
  • No-Code Classes
1 Like

@boston85719 the trick is to use spacers as @J805 said, remember bubble snaps to edges > it’s the magic sauce to bubble repo design - pinned to X. If your group is pinned it will slide with it.

If your groups are just left floating mid-page, you’ll pull your hair out trying to juggle %'s. If they are holding onto something, the will behave.

As an added note, always ensure your groups stack into 12… the magic number in layouts.

1 Like

Final word (I promise)

Don’t use 1200px - I have no idea why bubble recommend this!!

That can’t be the final word…you have to tell me the recommended page width :stuck_out_tongue_winking_eye:


That is what I ended up doing after posting this. One issue I have with that method besides it taking the time to put those extra spacer groups in is when I set to no background I usually forget they are present…another annoyance for me is I get too lazy to name them and then forgot what they are when viewing the element tree later in time.

But yes, that is the work around until bubble maybe implements something similar to the idea of a rule to place on the element.

1 Like

This should explain it better mate

Nice. Thanks for that. Will have to implement on the next project.

here’s the tool I use to map out %

1 Like

I just came up with a fix for this.

I created the group element that I want to stay the same size. Then I place that group into a container group that spans the width of the page. Both of these groups have a fixed width…the elements inside the group I want to decrease width are not set to fixed width.

The main container group has left and right margins set to 20px, or whatever margins required. I set the color of the margins to transparent.

By the way, I pinged you because I took this concept of the margin from your posts on sliding the page elements when a side menu is displayed utilizing a large left margin in conditonals.

1 Like

Glad you got it to work! :blush: There are so many ways to do one thing in Bubble. :+1: