Change margins to text in image with text section in mobile only (Dawn Theme)

Topic summary

A user seeks to reduce left margin on mobile and top margin on desktop for an Image with text section on their Dawn 12.0.0 theme homepage. The theme editor lacks built-in spacing controls for this customization.

Solutions provided:

  • Mobile margin fix: Add CSS code to component-image-with-text.css targeting .image-with-text__content with a media query at max-width 749px, setting left and right padding to 0.

  • Desktop top margin fix: Initially suggested adding padding-top adjustments to base.css, but this didn’t work. The solution was ultimately to paste the code into component-image-with-text.css instead.

Resolution: The user successfully implemented both fixes by adding CSS to the component-image-with-text.css file, adjusting padding sizes as needed. The issue is now resolved with improved spacing on both mobile and desktop views.

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

Hi there,

I have a problem with the last section of the home page of the website, it’s a ‘Image with text’ section and I would like to reduce the left margin on mobile only and the top margin on desktop only, see screenshots below. There aren’t options to control this spacing on the editor, so I think I would need to add some code. Any suggestions?

I used Dawn theme 12.0.0, below the link to my website:

https://900artanddesign.com/

2 Likes

@Andrecolap

oh sorry for that issue can you please try this code

  1. Go to Online Store->Theme->Edit code
  2. Asset->/component-image-with-text.css ->paste below code at the bottom of the file.
@media (max-width: 749px) {
.image-with-text__content {
    padding-left: 0;
    padding-right: 0;
}
}

Hi @Andrecolap

Check this one.

From your Shopify admin dashboard, click on “Online Store” and then “Themes”.

Find the theme that you want to edit and click on “Actions” and then “Edit code”.

In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

.image-with-text__content {
    padding-top: 2rem;
}
@media only screen and (max-width: 749px){
.image-with-text__content {
    padding-left: 2rem;
}
}

And Save.

Result:

Note: You can adjust the padding size you like.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

hello @KetanKumar

Thanks for your message.

That worked for the mobile version, thank you, but didn’t work on the desktop, where I would still like to get rid of the top margin above the title and align it to the picture to the left (see screenshot below). Any idea?

hello @Made4uo-Ribe

I tried to paste this in base.css but didn’t work.

Thank you anyway

Try to paste in component-image-text-with-text.css.

And Save. Thanks!

Thank you @Made4uo-Ribe

That works well, I adjusted the padding size and I think now it is better than before.

Thank you

1 Like

Good to hear! Welcome.