Home > Shopify Tutorials > How to Remove white space in Shopify?

How To Remove White Space Between Sections on Shopify

Last updated: September 01, 2024
Written and researched by experts at AvadaLearn more about our methodology

By Sam Nguyen

CEO Avada Commerce

White space, while essential for visual clarity and readability, can become problematic when it’s excessive. On a Shopify store, they can create a disjointed layout, forcing customers to scroll more and potentially leading to a less engaging experience.

In this guide, I’ll walk you through simple steps to remove white space between sections on your Shopify store, helping you achieve a sleek, cohesive look for your online store. Let’s dive in and get your Shopify layout looking its best!

Understanding the Causes of White Space on Your Shopify Store

Before diving into solutions, let’s explore the typical culprits behind those pesky gaps:

  • Theme Settings: Many Shopify themes include built-in padding or margins between sections to improve readability and aesthetics. While this can make your store look cleaner, it might also lead to excessive white space. Shopify 2.0 themes offer settings within the theme editor to adjust this spacing directly.
  • Section Dividers: Section dividers create a visual separation between content areas, which can add to the white space if not carefully managed. Some themes allow you to disable these dividers within the theme editor.
  • App-Generated Content: Third-party apps can sometimes add elements that contribute to unwanted white space, such as extra margins or new sections. In such cases, you’ll need to explore the app’s settings or contact the app developer for potential solutions.

How To Remove White Space Between Sections on Shopify

There are two primary methods to tackle this issue:

Remove White Space From Theme Editor (For Shopify 2.0 Themes)

This method is the easiest and most recommended, especially for those without coding experience. Here’s how:

  • Step 1: Go to Online Store > Themes.

Remove White Space Between Sections on Shopify

  • Step 2: Click Customize.

Remove White Space Between Sections on Shopify

  • Step 3: In the left sidebar of the theme editor, find the section where you want to remove white space. Let’s take the Header as an example.
  • Step 4: Look for Spacing or Section Padding within the section settings. Adjust the margin and padding to decrease or eliminate the white space. Then click Save.
Remove White Space Between Sections on Shopify

Remove White Space By Editing The Code (For Advanced Users)

If your theme doesn’t offer built-in spacing controls or you need more advanced adjustments, you can edit your theme’s code directly. However, this method requires some knowledge of CSS and your theme’s structure.

  • Step 1: Go to Online Store > Themes.
  • Step 2: Click icon > Edit code.

Remove White Space Between Sections on Shopify

  • Step 3: Click theme.liquid.

Remove White Space Between Sections on Shopify

  • Step 4: Remove or adjust the CSS styles that are causing the white space.

For example, to remove top and bottom margins from a section, you could add the following CSS:

.section-name {
    margin-top: 0;
    margin-bottom: 0;
}

Or, to change the padding of a box, you can use this code:
<style>
.box{
padding:10px 0 !important
}
</style>
  • Step 5: Save your changes.

4 Tips and Best Practices

Here are five tips and best practices for removing white space between sections in Shopify:

  • Test on Different Devices: Always preview your changes on both desktop and mobile devices to ensure they look good across all screen sizes.
  • Maintain Visual Balance: Don’t remove all white space. Some spacing is necessary for readability and visual appeal. Aim for a balanced layout that’s easy on the eyes.
  • Backup Your Theme: Before making any code edits, create a backup of your theme file, in case you need to revert to the original version.
  • Theme-Specific Instructions: Consult your theme’s documentation or support for any specific guidance on adjusting spacing or layout.

Common Problem & Troubleshooting

Here’s a guide to common problems and troubleshooting tips for removing white space between sections in Shopify:

Inconsistent Padding and Margins

Problem: Adjusting padding or margins in the theme settings or CSS doesn’t produce consistent results across all sections.

Troubleshooting:

  • Check Specificity: Ensure that the CSS rules you’re applying are specific enough to override existing styles.
  • Theme Overrides: Look for theme-specific settings or overrides that may be applying additional padding or margins. Some themes have built-in settings that might conflict with your customizations.

Section Dividers Not Adjusting

Problem: Section dividers remain unchanged or don’t respond to adjustments in the theme settings.

Troubleshooting:

  • Edit Theme Code: If you can’t find settings to adjust the dividers, you may need to modify the theme code directly. Check the theme’s HTML and CSS files for the section divider styles and adjust them as needed.
  • Clear Caches: After making changes, clear your browser cache to ensure that you’re seeing the most recent version of your store.

App-Generated White Space

Problem: Third-party apps are creating additional white space that you can’t easily remove.

Troubleshooting:

  • App Settings: Review the app’s settings to see if there are options to adjust or remove extra space. Some apps allow customization of margins and padding.
  • Contact Support: If the app doesn’t provide enough control, reach out to the app’s support team for guidance on managing or reducing the white space.

Responsive Design Issues

Problem: Changes to white space affect the layout differently on various devices or screen sizes.

Troubleshooting:

  • Responsive CSS: Use media queries in your CSS to ensure that white space adjustments apply correctly across different devices. Test your store on various screen sizes to ensure a consistent appearance.
  • Preview Modes: Utilize Shopify’s preview modes to check how changes impact mobile and desktop views.

Code Conflicts

Problem: Custom CSS or theme modifications cause layout issues or conflicts with existing styles.

Troubleshooting:

  • Incremental Changes: Make changes incrementally and test frequently to identify which adjustments are causing issues. This approach helps isolate the problem.
  • Backup and Restore: Always back up your theme before making significant changes. If you encounter issues, you can revert to the previous version.

Bottom Line

Removing white space can detract from your Shopify store’s aesthetic and user experience. By using the theme editor or custom CSS, you can easily remove or adjust this unwanted spacing. Remember to prioritize visual balance and test your changes thoroughly to ensure your store looks and functions flawlessly.


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.