How to reduce the gap between heading and image

Topic summary

A user seeks to reduce excessive spacing between a heading and image in the featured collection section on mobile devices for the Prestige theme.

Problem:

  • Too much gap between heading and product images on homepage (mobile only)
  • Initial CSS solutions from multiple responders didn’t work

Solutions Attempted:

  1. ZestardTech suggested adding CSS to theme.css targeting .section-stack with reduced gap and margin
  2. niraj_patel recommended inserting CSS in theme.liquid before </body> tag, adjusting .section-spacing.bordered-section margins
  3. Anshul_arora provided similar CSS approach focusing on removing unnecessary spacing above/below headings

Resolution:

  • User confirmed Anshul_arora’s solution worked after implementation
  • The fix involved adding media query CSS (max-width: 767px) to reduce gap and margin-top values
  • Screenshots were shared throughout to illustrate the spacing issue and code placement
Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

For phone version only, on home page featured collection, how to reduce the space between heading and image?

Theme: Prestige

Website: https://prettycious.com/

1 Like

Hi @memahmudhassan

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find Asset > theme.css and paste this at the bottom of the file:
@media screen and (max-width: 750px) {
    .section-stack {
	    gap: 1px;
	}
    .section-spacing.bordered-section {
        margin-top: 0;
    }
}

Hello @memahmudhassan

You can add code by following these steps

  1. Go to Online Store → Theme → Edit code.

  2. Open your theme.liquid file

  3. Paste the below code before on theme.liquid

@media screen and(max-width: 767px){ .h2, :where(.prose h2) { font-size: 19px !important; } .section-stack { gap: 0 !important; } }

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Hello @memahmudhassan ,

I understand you are looking to reduce the unnecessary space between the heading and the image.

I have reviewed your store and see that on the mobile screen the unnecessary space above and below the heading does not look appropriate.

You can remove the space with the help of the mentioned CSS code.

Add the code at the bottom of the theme.liquid file before tag and save.


Output -: https://prnt.sc/w9SlRiYI_JHU

I hope the code helps you.

Please share if you need any further assistance.

Thank you.

1 Like

Not working. Also, I think the total gap is too much.

1 Like

Not working. Also, I think the total gap is too much.

Hi @memahmudhassan

Can you please share a screenshot of the file where you added CSS?

@media screen and (max-width: 750px) {
.section-stack {
gap: 1px;
}
.section-spacing.bordered-section {
margin-top: 0;
}
}

You can add code by following these steps

  1. Go to Online Store → Theme → Edit code.

  2. Open your theme.liquid file

  3. Paste the below code before on theme.liquid

@media screen and(max-width: 767px){ .section-spacing.bordered-section { margin-top: 10px !important; } .section-stack { gap: 20px !important; } .section-stack .prose p { display: none; } }

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Did what you told

Thanks Anshul, it worked!