Resize Image in Image with Text - Center & Remove Padding.

Solved

Resize Image in Image with Text - Center & Remove Padding.

Danceddiction
Excursionist
31 0 8

I am trying to resize an image in Dawn theme for Image with Text Section. 

I can resize it just fine, but then it pulls it off center and creates a huge padding between the image and the text section. See below.

Danceddiction_0-1728004741374.jpeg

I'm resizing the image the following way in base.css and doing it only for mobile screens

#shopify-section-template--18442698719487__image_with_text_nQxqbR img {
    width: 300px;
    height: auto;
  }

 How can I keep the image centered and remove the padding below it? 

website: www.danceddiction.com/pages/about-us
password: testword

Accepted Solution (1)

Dan-From-Ryviu
Shopify Partner
11737 2301 2485

This is an accepted solution.

Please update your code to this 

 

#shopify-section-template--18442698719487__image_with_text_nQxqbR img {
    width: 300px;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
}
#shopify-section-template--18442698719487__image_with_text_nQxqbR .image-with-text__media { 
    padding-bottom: 69% !important; 
}

Screenshot 2024-10-04 at 08.41.38.png

 

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

View solution in original post

Replies 5 (5)

namphan
Shopify Partner
2690 349 399

Hi @Danceddiction,

Please change code:

#shopify-section-template--18442698719487__image_with_text_nQxqbR img {
    width: 300px;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
}
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com

Dan-From-Ryviu
Shopify Partner
11737 2301 2485

This is an accepted solution.

Please update your code to this 

 

#shopify-section-template--18442698719487__image_with_text_nQxqbR img {
    width: 300px;
    height: auto;
    left: 50%;
    transform: translateX(-50%);
}
#shopify-section-template--18442698719487__image_with_text_nQxqbR .image-with-text__media { 
    padding-bottom: 69% !important; 
}

Screenshot 2024-10-04 at 08.41.38.png

 

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

Danceddiction
Excursionist
31 0 8

This worked perfectly thank you!

BSSCommerce-B2B
Shopify Partner
1972 564 568

Hi @Danceddiction , 

I have reviewed your requirement, you just need to edit css script and the issue will be resolved.  You can follow my instructions! 

 

Step 1: Go to Admin -> Online store -> Theme > Edit code:

BSSCommerceB2B_0-1728006202960.png

Step 2: Search for the file base.css. And add this code snippet to the end of the file.

 

@media (max-width: 748px) {
    #shopify-section-template--18442698719487__image_with_text_nQxqbR img {
        width: 300px;
        height: auto;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
   .image-with-text__text.rte.body {
         margin-top: -40px !important;
    }
}

 

 

Step 3: Save and reload home page.

=>> The result: 

BSSCommerceB2B_2-1728006261105.png

 

I hope these instructions will help you. If they are helpful, please give us likes and mark as the solution.

Have a nice day sir!

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

Tech_Coding
Shopify Partner
514 132 131

Hello @Danceddiction 

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 </body> on theme.liquid
<style>
@media screen and (max-width: 767px) {
   #shopify-section-template--18442698719487__image_with_text_nQxqbR img {
         width: 303px;
         height: auto;
         left: 50% !important;
         transform: translateX(-50%) !important;
   }
    #shopify-section-template--18442698719487__image_with_text_nQxqbR .image-with-text__media {
         padding-bottom: 69% !important;
    }
}
</style>

Tech_Coding_0-1728007687334.png

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

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.