All things Shopify and commerce
Hi there - I'm using the Dawn theme and on my homepage I have two "Text with image" containers. I've managed to make the image square by pasting the following code in the theme.liquid section above the tag </head>:
<style>
.image-with-text .image-with-text__media-item.image-with-text__media-item--small{
width: 50% !important;
}
</style>
I would like the images to remain square but make them smaller - maybe 75% of the current size. Here is the current page - https://29and11.com/ Could anyone help me with that?
Thank you!
Solved! Go to the solution
This is an accepted solution.
Yep, since you take 30% of 100% height n width. We can add 15% margin.
The margin will add automatic in all sides.
.image-with-text .image-with-text__media-item.image-with-text__media-item--small img {
height: 70%;
width: 70%;
margin: 15%;
}
And Save.
Result;
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Hi @hnaegele
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 .image-with-text__media-item.image-with-text__media-item--small img {
height: 75%;
width: 75%;
}
And Save.
Result:
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
That definitely made the pictures the size I was hoping for - thank you!! Now my issue appears to be that they aren't centered with the text. Is there a way to center them and have the spacing between the picture and text equal with the space on the margins? In the top text with image container, the margins to the right of the picture are large, and in the lower text with image container, the space between the picture and text is large. Is there some way to evenly distribute the spacing?
Thank you so much!!
This is an accepted solution.
Yep, since you take 30% of 100% height n width. We can add 15% margin.
The margin will add automatic in all sides.
.image-with-text .image-with-text__media-item.image-with-text__media-item--small img {
height: 70%;
width: 70%;
margin: 15%;
}
And Save.
Result;
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
That worked perfectly - thank you so much for your help!! You are a lifesaver!!! - Haley
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025