Site logo

Archived topic

Align center buttons only on mobile

11 replies · Started by Matteo on March 21, 2021

Viewing posts 1–12 of 12

Hi,

on the homepage (hero zone) I have two buttons.

I'd like to center them only on mobile.

How can I do?

Thanks.

I like it for desktop but not for mobile.

In fact, it works well on desktop but not on mobile.

On desktop I want the buttons horizontally align.

On mobile I want the button vertically and centered aligned (inside the button container).

This solution allowed me to center the buttons on mobile, but I'd like the buttons left-aligned on desktop and center-aligned on mobile. It's not possible from the editor.

Hi there,

This solution allowed me to center the buttons on mobile, but I’d like the buttons left-aligned on desktop and center-aligned on mobile. It’s not possible from the editor.

I've tried checking your site and it seems to be in maintenance mode.

We can try the custom CSS approach.

If you could temporarily lift the maintenance mode so we could inspect, we can help you out with the CSS @media rule for your buttons so we could control separately for mobile and desktop.

Now the site is live

If I change the alignment on mobile it changes at the same time on desktop.

Try this:

Select the wrapper of the GB Button block and set center-on-mobile on its Additional CSS class(es) field.
https://share.getcloudapp.com/yAuDoPQ6

You then add this CSS:

@media(max-width:768px){
.center-on-mobile{
 justify-content: center;   
}
}
This archived topic is closed to new replies.