I would like to decrease the space here on my home screen, just for mobile view:
Topic summary
A user seeks to reduce spacing between sections on their mobile homepage, specifically targeting the gap visible in their screenshot.
Three solutions provided:
-
CSS modification (BSSCommerce-B2B): Add custom CSS to
base.csstargeting the slider component with negative margin-bottom (e.g.,-30px), adjustable to preference. -
Theme.liquid approach (BSS-TekLabs): Insert CSS code in
theme.liquidbefore</head>tag to control section spacing. -
Alternative placement (PageFly-Richard): Similar CSS solution but placed before
</body>tag intheme.liquid.
All solutions involve adding CSS code snippets to theme files through the Shopify admin panel (Online Store β Themes β Edit code).
Follow-up question: A user asks whether these solutions work universally for all sections or only headers, specifically mentioning spacing between an image and slideshow section. This question remains unanswered, suggesting the original solutions may be component-specific rather than universal.
Hi @lukafernada ,
Step 1: Go to Admin β Online store β Theme > Edit code:
Step 2: Search for the file base.css. And add this code snippet to the end of the file.
slider-component.slider-mobile-gutter.slider-component-desktop.scroll-trigger.animate--slide-in {
margin-bottom: -30px !important;
}
IN this step, you can change the value of margin-bottom as you want to decrease the space.
In my example, I choose -30px
Step 3: Save and reload home page.
=>> The result:
I hope thse instructions will help you. If they are helpful, please give us likes and mark as the solution.
Have a nice day sir!
- Here is the solution for you @lukafernada
- Please follow these steps:
- Go to Online Store β Theme β Edit code.
- Open your theme.liquid file
- In theme.liquid, paste the below code before and press βSaveβ to save it
- Here is the result you will achieve:
- Please press βLikeβ and mark it as βSolutionβ if you find it helpful. Thank you.
This is Richard from PageFly - Shopify Page Builder App
Hi @lukafernada Please add code here to fix it:
Step 1: Online Stores > Themes > Edit code
Step 2: Choose file theme.liquid
Step 3: Add code above the tag
Hope my solution will help you resolve the issue.
Best regards,
Richard | PageFly
Does this code work for all sections or just header? Iβm trying to do the same thing but itβs not my header I added an image on header and added a slideshow under and thereβs space between the sections I want to add an image behind my slideshow and reduce sections do you have help for both? Pls! Thank you



