How can I resize the banner image section to fit text?

Hi guys,

im trying to make this section smaller, so it just fits the text inside.

I tried a lot, sadly im at my limits. :joy:

PW: 2023

1 Like

Hi @MyEcomAgent

You can also adjust the height of your image, I think that is a better way. But if you are not able to do it, you can do the following instructions below.

  • 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:
div#Banner-template--19895546118478__aa752136-1f0d-4e06-8fcb-7fb84abe85fa .banner__media.media {
 height: 100px; 
}

div#Banner-template--19895546118478__aa752136-1f0d-4e06-8fcb-7fb84abe85fa {
    min-height: 100px;
}

div#Banner-template--19895546118478__aa752136-1f0d-4e06-8fcb-7fb84abe85fa img {
    object-fit: cover;
    height: 200px;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
}
  • And Save.

NOTE: Adjust the padding of your sections to match the spaces.

  • Result:

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

1 Like