Why are parts of my mobile slideshow image off-center?

Hey Shopify Support Team,

I’m dealing with a pretty annoying problem on my Shopify store, and I could use some assistance. Here’s the deal: my slideshow banner looks great on desktop, but when it comes to mobile, the images are way off-center. To try and fix it, I messed around with the CSS code, adding “margin-left: -100px” for when the screen is less than 767px in width. That managed to center the part of the image I wanted on mobile, but there’s a big issue – a chunk of the image is now missing.

I’ve scoured the ‘component-slideshow.css’ file and tried all sorts of tweaks, but I’m not having any luck. Just so you know, I’m using the Taste theme.

I know it’s a bit of a head-scratcher, but any help or advice you could provide would be super appreciated. It’s bugging me, and I’m eager to get it sorted out.

If you need more info or access to my store to dig into this, feel free to give me a shout. Your quick response and insights would be a game-changer, and I’m really hoping you can help me out.

CSS code added to component-slideshow.css:

/* Mobile styles */
@media screen and (max-width: 767px) {
.slideshow__slide {
overflow: visible;
}
.slideshow__slide img {
/* Remove max-width constraint */
min-width: 100%;
/* Adjust margins and scaling */
margin-left: -100px;
transform: scale(1.5);
}
}

DESKTOP:

MOBILE:

Hi @brightnight1012

Please drop your page link here to check

vanishpen.co

Your store has password protected

Try now, temporarily removed it.

Please remove margin-left: -100px; in your this code

.slideshow__slide img {
/* Remove max-width constraint */
min-width: 100%;
/* Adjust margins and scaling */
margin-left: -100px;
transform: scale(1.5);
}
}

And then add this addition code

.slideshow__slide img {
object-position: center right !important;
}

Thanks! But now too much of the left side of the image is cut off. I want the persons that are in the image to be perfectly in the middle of the image when viewed on mobile.

Change my code to this

.slideshow__slide img {
    object-position: -200px center!important;
}

Code:

/* Mobile styles /
@media screen and (max-width: 767px) {
.slideshow__slide {
overflow: visible;
}
.slideshow__slide img {
/
Remove max-width constraint /
min-width: 100%;
/
Adjust margins and scaling */
margin-left: -100px;
transform: scale(1.5);
}
}

.slideshow__slide img {
object-position: -200px center!important;
}

Result:

Please remove margin-left: -100px; from your code

Thanks a bunch! So, the main thing I’m struggling with is getting the characters from my photos smack in the middle of the mobile screen. Any tips on how to make that happen?

Change my code to this

.slideshow__slide img {
    object-position: -280px center!important;
}

I figured it out!

/* Mobile styles /
@media screen and (max-width: 767px) {
.slideshow__slide {
overflow: visible;
}
.slideshow__slide img {
/
Remove max-width constraint /
min-width: 100%;
/
Adjust object-position to move image 100px to the right */
object-position: -300px center!important;
}
}

EDIT: I find it funny we came to the conclusion at exactly the same time lol.

1 Like