How do I adjust image size on my blog to a percent?

Solved

How do I adjust image size on my blog to a percent?

ChicPlantBoutiq
Visitor
2 0 2

I want to adjust my picture size to 50% of the container width. The only option I see in the editor is to set it to a specific pixel width. It looks great on desktop, but horrible on mobile. This is an example of the code I am trying to edit:

 

<div style="text-align: left;"><img style="margin-right: 10px; float: left;" alt="Parlor Palm in Sunlight" src="https://cdn.shopify.com/s/files/1/0664/8522/3619/files/sunlight_480x480.png?v=1732194399"></div>

 

From this URL: https://chicplantboutique.com/blogs/all-things-planty/houseplant-myths-debunked-the-truth-about-ligh...

 

Thanks!!

Accepted Solution (1)

Moeed
Shopify Partner
6292 1711 2056

This is an accepted solution.

Hey @ChicPlantBoutiq 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (max-width: 767px) {
.article-template__content.page-width.page-width--narrow.rte.scroll-trigger.animate--slide-in img {
    max-width: 50% !important;
}
}
</style>

RESULT:

Moeed_0-1732196704131.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Create high-converting pages - PageFly Page Builder.


View solution in original post

Replies 4 (4)

Moeed
Shopify Partner
6292 1711 2056

This is an accepted solution.

Hey @ChicPlantBoutiq 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (max-width: 767px) {
.article-template__content.page-width.page-width--narrow.rte.scroll-trigger.animate--slide-in img {
    max-width: 50% !important;
}
}
</style>

RESULT:

Moeed_0-1732196704131.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Create high-converting pages - PageFly Page Builder.


ChicPlantBoutiq
Visitor
2 0 2

Thank you so much! That is exactly what I needed! You're the best 🙂

Moeed
Shopify Partner
6292 1711 2056

Thank you for your reply. I'm glad to hear that the solution worked well for you. If you require any more help, please don't hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Create high-converting pages - PageFly Page Builder.


Sorin_Iulian
Shopify Partner
6 0 0

Try this, <div style="text-align: left;width: 100%;"><img style="margin-right: 10px; float: left;max-width:50%" alt="Parlor Palm in Sunlight"