Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello there!
Could anybody please help me with the code required to reduce the white space between sections/elements on the homepage of my Brooklyn theme? I want the white space between all sections shrunk by half.
Thank you for your support!
Hi @StoreHelpNeeded,
Go to Assets > theme.scss.liquid and paste this at the bottom of the file:
/*================ code for desktop ================*/
.index-sections .shopify-section {
margin-top: 45px !important;
}
@media screen and (max-width: 768px) {
/*================ code for mobile ================*/
.index-sections .shopify-section {
margin-top: 25px !important;
}
}
Hope it helps!
This is Noah from PageFly - Shopify Page Builder App
Please add this code to your theme.liquid above the </head> to get this solved
Step 1: Online Stores > Themes > More Actions > Edit code
Step 2: click on theme.liquid and paste the code above the </head>
<style>
.index-sections .shopify-section {
margin-top: 15px;
}
</style>
This is reduced half of the current spacing now
Hope this can help you solve the issue
Best regards,
Noah | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025