Hi,
I’m using the Dawn 2.0 theme.
In the top of my home page there is an ‘image with text’ section.
On the desktop version, the image is cut in the sides, therefore I want to decrease the image size, so the whole image will fit in.
How can I do it?
https://wortheattt.myshopify.com/
Thanks
1 Like
@Ben1000
sorry for that issue can you try this code
- Go to Online Store->Theme->Edit code
- Asset->/base.css ->paste below code at the bottom of the file.
.media>img {object-fit: contain;}
1 Like
Hi Ben,
I played around in devtools and found this css prop. This can solve the thing for you but might also change how images are displayed throughout the store.
1 Like
Hi @malipetek @KetanKumar ,
Thanks, but it works to all sections:
- Only the desktop version
- Only for the ‘image with text’ section in the top of my home page.
Besides that, is there an option to control the size of the image and increase/decrease the image as much as I want?
If you want it to be that way only on that specific section and desktop view, you can do something like this:
@media only screen and (min-width: 750px) {
#MainContent>.shopify-section:first-child .media>img { object-fit: contain; }
}
And no there is no settings to fine tune image size, position etc. You can add it tho by modifying your theme.
Hi @malipetek ,
Thanks, but I also want it to be only on the first section in my home page (14625265319989__16459638514e39b28f)
https://wortheattt.myshopify.com/
1 Like
@Ben1000
try this
@media only screen and (min-width: 750px) {
#MainContent>#shopify-section-template--14625265319989__16459638514e39b28f:first-child .media>img { object-fit: contain; }
}
1 Like
That css selector should apply to only first section already. Look:
Hi @malipetek @KetanKumar
Thank you for the solutions, they are working well.
@malipetek does “first child” means “the first section” in the current page?
2 Likes
My pleasure Ben,
:first-child means first child, check this out:
@Ben1000
its my pleasure to help us