All things Shopify and commerce
Hi
How do I reduce the space above and below the "button" of my Image Banner, in Mobile view, so it kind of sits just below with reasonable spacing.
I have attached a photo.
Thanks
Hi Zoose!
Unfortunately, I can't see the attached photo.
But when we talked about the top/bottom space, between some elements, we can use different types of techniques to achieve this.
1. Margin
This property can be used to set a margin on all four sides of an element. Margins create extra space around an element.
2. Use the display property. Namely, display: flex; or display: grid;
They have additional options that allow you to create the right space between elements.
Read more about this in the documentation below:
Also, you mention that it should work only in mobile view. To achieve this, you can add media queries, for example:
@media (min-width: 768px) { display: none; }
This CSS will only apply styles if the width of your browser's viewport is equal to or greater than 768px.
If we're talking about your situation, it's the styles that can work for you.
.wrapper { display: flex;
flex-direction: column;
justify-content: space-around; }
@media (min-width: 768px) { display: none; }
P.S. It will only work on devices with a width of less than 768 pixels.
I hope that my answer helps you to resolve the issue. If you need a more detailed explanation or further help - just contact me.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025