How to delete extra spacing between Text and Image/Icon

Topic summary

A user is experiencing inconsistent spacing between text and icons/images on their Shopify store pages. The issue appears in the page editor as no extra lines, but renders with unwanted gaps on the live site.

Initial Solution Attempted:

  • A CSS fix was provided targeting .rte.scroll-trigger.animate--slide-in p with margin: 0 !important; in the base.css file
  • This successfully removed spacing after icons but created a new problem: eliminated all spacing after titles site-wide
  • Adding manual line breaks in the editor creates excessive spacing

Current Status:

  • The spacing behavior is inconsistent across different pages—some titles have spacing, others don’t
  • User needs a more targeted solution that only affects spacing after icons/images, not all paragraph elements
  • A responder indicated this requires custom code to assign specific classes to images and target them individually via CSS
  • The issue remains unresolved, with the user requesting additional help to implement the more precise solution
Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Hi lovely community,

is it possible to delete the extra spacing between the text and the icon here:

Here is the page:

https://www.chevaldore.com/pages/how-to-win-the-war-on-drugs

Kinda like here:

In the editor it is not possible, aparently there is no extra line:

Please HELP :smiley:

Have a lovely weekend.

God bless ya

Kind regards

Juls :smiley:

Hey Juls,

Yes this is possible to remove the extra space between the icon and text.

Paste this code in the end of base.css file.

.rte.scroll-trigger.animate--slide-in p {
    margin: 0 !important;
}

Here is how you can find the base.css file.

Go to Shopify Admin > Online Store > Edit Code > base.css

Lovely weekend.

Cheers :slightly_smiling_face:

Hi Flow,

thanks for the quick reply.

I tried it and it worked for the pictures. BUT now all the space after the title is gone. And if i add an extra line with the editor the spacing is to big.

Picture attached:

Is there a way to just cut the spacing after the icons? On this pages:

https://www.chevaldore.com/pages/how-to-end-the-war-on-drugs

https://www.chevaldore.com/pages/partners-purpose-of-donation

This is possible and this need to do code in your theme file to assign a class to the picture only and target it via css.

Ok can you help me out with it?

Its a bit strange, sometimes there is a spacing after the title, and sometimes there isnt…

I mean Im fine with one or the other. But mixed up looks a bit strange :smiley:

Here it looks sweet because it is all the same:

https://www.chevaldore.com/pages/partners-purpose-of-donation